Open GoogleCodeExporter opened 9 years ago
I do not wonder that you are not 100% sure in the analysis. This is very old,
and worse still, optimized code from Apache James. This class
(CRLFOutputStream) is strongly tied to ExtraDotOutputStream through inheritance
and their responsibilities become mixed.
The writeChunk method is overriden in ExtraDotOutputStream class, and it
expects a full or partial line as input.
Your patch would pass an input which contains more lines, therefore it is not
correct.
Interestingly, the original class is wrong too. Its write(int) method bypasses
writeChunk altogether. But this does not cause any issues for us, because that
function is not used in SubEthaSMTP.
An actual solution is not far however. I believe that the two classes can be
refactored, so that they become separated completely. Instead of inheritance,
CRLFOutputStream should wrap the ExtraDotOutputStream. In this way you can
optimize the write(buffer) method of both class, and still not create a mess.
If you write a new patch, please add the result of a basic measurement, like in
your other performance related patch, so we can apply it as happily as in that
case.
Original comment by hontvari@flyordie.com
on 11 Mar 2013 at 11:08
Original comment by hontvari@flyordie.com
on 12 May 2013 at 12:50
Original issue reported on code.google.com by
miah.n...@gmail.com
on 5 Mar 2013 at 8:52Attachments: