EVALUATION
This bug can be reproduce independently of Java Plugin.
This is a bug in the handling of errorStream buffering when the response body is chunked and the its size is greater than the errorStream.bufferSize, default 4K.
As we do not know the content length of a chunked response body we simply set the expected amount to the size of the errorStream buffer, default 4K. That way we will read until EOF or errorStream.bufferSize. The problem only arises when the response body is greater than the
errorStream.bufferSize. The logic that determines if all the response body has been read incorrectly determines that it has. This is because we have set the expected amount be the same as the errorStream.bufferSize.
The only way to determine if a chunked response body has been complete read it to reach EOF.
|
EVALUATION
This bug appears because web service client cannot read more than 4KB of data through plugin's HttpURLConnection.
Please, unzip an attached test, build test code with build.sh and run server with run-server.sh.
Test client class client.Client simulates web service client activity. When it is run as a standalone application the output is:
====================================================
-- [ 500 (should be 500) Internal Server Error ] --
HTTP/1.1 500 Internal Server Error
Transfer-encoding:chunked
Content-type:text/xml; charset=utf-8
<?xml version="1.0" ?><S:Envelope ...
Response length: 4140
======================================================
When run in applet:
======================================================
HTTP/1.1 500 Internal Server Error
Transfer-encoding:chunked
Content-type:text/xml; charset=utf-8
<?xml version="1.0" ?><S:Envelope ...
Response length: 4096
=======================================================
Note the difference in the length of response.
Also, note that there is no exception reported to client
in this case.
Version information:
Mozilla version: Mozilla/5.0 (X11; U; SunOS i86pc; en-US; rv:1.8.1.1) Gecko/20070226 Firefox/2.0.0.1
Plugin versions: 1.6.0, 1.6.03-ea
|