Xueming Shen wrote:
Alan,
After staring those simple, 11 lines of change for minutes, I believe
we should simply
go back with the original approach at
http://cr.openjdk.java.net/~sherman/6858865/webrev.00
The change in
http://cr.openjdk.java.net/~sherman/6858865/webrev.00
obviously is problematic, especially in case like in_len == 0 but
out_len != 0 (no more,
or no more new input, but with a valid output buffer), it's definitely
possible the
inflater/deflater might have more bites to (and should) output in this
scenario, it's a
bug to return 0 here.
Sure it's possible to go further like
if (in_len == 0)
return 0;
....
if (len == 0)
...
But given the purpose of this fix is to solve that particular
"regression" (which actually
does not cause any regression for "mainstream" platforms), I prefer
not take the risk
of causing another real regression/behavior change here, especially we
got burned
couple times here in the past when tried to do better.
Agree?
-Sherman
I understand the concern but I don't think that patch-1 is risky. That
is, for Inflater, I can't see any side effects to simply returning 0 if
either length is 0. Same thing for Deflater when not in the code path
that calls deflateParams. For the deflateParams cases then the changes
in the latest patch is fine with me.
-Alan.