The following line seems to have problem geting the chunk-size.
contentLen = Long.parseLong(new String(chunkSizeLine.getBytes(), 0, chunkSizeLine.length()-2));
I have modified the line as follow:
contentLen = Long.parseLong(chunkSizeLine, 16);
and it works properly now.
Regards,
Peik Feng
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
I also met this problem and found solution same as found Lee Peik Feng.
Why do you cut 'chunkSizeLine' ?
Java documentation say:
"
BufferedReader.readLine() return
a String containing the contents of the line, not including any line-termination characters, or null if the end of the stream has been reached
"
Regards!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
I am using clink 170 and having problem with Chunked Transfer Coding.
According to http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.6.1
The chunk-size field is a string of hex digits
But in HTTPPacket.set(InputStream in, boolean onlyHeaders)
The following line seems to have problem geting the chunk-size.
contentLen = Long.parseLong(new String(chunkSizeLine.getBytes(), 0, chunkSizeLine.length()-2));
I have modified the line as follow:
contentLen = Long.parseLong(chunkSizeLine, 16);
and it works properly now.
Regards,
Peik Feng
Hi Peik,
Thanks for your bug report.
I will fix the bug as following.
contentLen = Long.parseLong(new String(chunkSizeLine.getBytes(), 0, chunkSizeLine.length()-2), 16);
I will check and fix other bugs for the chunked stream, and
release as the next minor version with your patch :-)
Hi,
I also met this problem and found solution same as found Lee Peik Feng.
Why do you cut 'chunkSizeLine' ?
Java documentation say:
"
BufferedReader.readLine() return
a String containing the contents of the line, not including any line-termination characters, or null if the end of the stream has been reached
"
Regards!