You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by Toshiro Takase <E3...@jp.ibm.com> on 2003/02/24 03:32:02 UTC
I fixed some bugs in Chunked{Input|Output}Stream. Would you fix these codes
in axis source tree?
Hello, Axis developers,
I found bugs in
org.apache.axis.transport.http.ChunkedOutputStream
and
org.apache.axis.transport.http.ChunkedInputStream
I fixed the bugs and tested with Coyote HTTP/1.1 server in Tomcat.
Would you fix Axis source tree?
----------
[ChunkedInputStream]
Line.85 (source code in Axis1.0)
>>wrong>> return rc > 0 ? d[0] : rc;
<<right<< return rc > 0 ? (d[0] & 0xFF) : rc;
InputStream.read() method should return positive int in the range from 0 to
225.
But, byte is cast to int in the range from -128 to 127.
This has no problem for ASCII code, but it has some problems for UTF8, GZIP
and so on.
----------
[ChunkedOutputStream]
Line.116 (source code in Axis1.0)
>>wrong>> out.write("\r\n0\r\n".getBytes());
<<right<< out.write("0\r\n\r\n".getBytes());
According to HTTP/1.1: section 3.6.1 Chunked Transfer Coding[1],
Chunked-Body = *chunk last-chunk trailer CRLF
chunk = chunk-size [ chunk-extension ] CRLF chunk-data CRLF
last-chunk = 1*("0") [ chunk-extension ] CRLF
chunk part is implemented in write(byte[] b, int off, int len) method,
last-chunk part is implemented in eos() method.
eos() should write not "CRLF 0 CRLF" but "0 CRLF CRLF".
Note that this code assumes no trailer or chunk-extension.
References:
[1] http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.6.1
Thanks in advance,
Toshiro TAKASE
Internet Technology, Tokyo Research Laboratory, IBM Research
notes ID: Toshiro Takase/Japan/IBM@IBMJP, e-mail: E30809@jp.ibm.com
Re: I fixed some bugs in Chunked{Input|Output}Stream. Would you fix these codes in axis source tree?
Posted by Davanum Srinivas <di...@yahoo.com>.
Please log this as a bug in http://nagoya.apache.org/bugzilla.
Thanks,
dims
--- Toshiro Takase <E3...@jp.ibm.com> wrote:
> Hello, Axis developers,
>
> I found bugs in
> org.apache.axis.transport.http.ChunkedOutputStream
> and
> org.apache.axis.transport.http.ChunkedInputStream
> I fixed the bugs and tested with Coyote HTTP/1.1 server in Tomcat.
> Would you fix Axis source tree?
>
> ----------
> [ChunkedInputStream]
> Line.85 (source code in Axis1.0)
> >>wrong>> return rc > 0 ? d[0] : rc;
> <<right<< return rc > 0 ? (d[0] & 0xFF) : rc;
>
> InputStream.read() method should return positive int in the range from 0 to
> 225.
> But, byte is cast to int in the range from -128 to 127.
> This has no problem for ASCII code, but it has some problems for UTF8, GZIP
> and so on.
>
> ----------
> [ChunkedOutputStream]
> Line.116 (source code in Axis1.0)
> >>wrong>> out.write("\r\n0\r\n".getBytes());
> <<right<< out.write("0\r\n\r\n".getBytes());
>
> According to HTTP/1.1: section 3.6.1 Chunked Transfer Coding[1],
> Chunked-Body = *chunk last-chunk trailer CRLF
> chunk = chunk-size [ chunk-extension ] CRLF chunk-data CRLF
> last-chunk = 1*("0") [ chunk-extension ] CRLF
>
> chunk part is implemented in write(byte[] b, int off, int len) method,
> last-chunk part is implemented in eos() method.
> eos() should write not "CRLF 0 CRLF" but "0 CRLF CRLF".
> Note that this code assumes no trailer or chunk-extension.
>
> References:
> [1] http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.6.1
>
> Thanks in advance,
> Toshiro TAKASE
> Internet Technology, Tokyo Research Laboratory, IBM Research
> notes ID: Toshiro Takase/Japan/IBM@IBMJP, e-mail: E30809@jp.ibm.com
>
>
>
>
>
=====
Davanum Srinivas - http://webservices.apache.org/~dims/
__________________________________________________
Do you Yahoo!?
Yahoo! Tax Center - forms, calculators, tips, more
http://taxes.yahoo.com/