You are viewing a plain text version of this content. The canonical link for it is here.
Posted to xmlrpc-dev@ws.apache.org by James Russo <jr...@halo3.net> on 2004/12/02 04:58:34 UTC
Issue with large responses and keepalive in LiteXmlRpcHandler
Hello,
I think I have found an issue with LiteXmlRpcHandler dealing with
large responses with keepAlive turned off. I've tracked it down to the
sendXmlRpc method in LiteXmlRpcTransport. Basically, the problem is that
sendRequest is called returning a ServerInputStream for the server
response. Soon after obtaining the ServerInputStream, if keepAlive is
turned off the connection is closed. This is before anyone calls read on
the input stream. When the parser finally gets to read the input stream
the connection is closed, and read in ServerInputStream throws a
IOException that the socket has been closed. I did not experience this
with smaller responses, but am experiencing this with a response that is
~9k. This first call to read is asking for 8192 bytes, so that may be
the magic number.
The only quick solution I can think of would be to consume the entire
response in the sendXmlRpc method, but that could turn into a large
amount of data, and defeat the purpose of using a SAX parser. Seems like
it would be better to indicate to the transport that the response has
been completely read and parsed and then it could closer connection if
needed. Or maybe modify ServerInputStream to close the connection once
all the data has been obtained if keepAlive is turned off?
This issue does not occur when using the DefaultXmlRpcTransport.
Anyone have any thoughts?
-James