Mantis Bugtracker
  

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0001149 [Resin] minor always 05-26-06 13:14 06-27-06 21:39
Reporter ferg View Status public  
Assigned To ferg
Priority normal Resolution fixed  
Status closed   Product Version
Summary 0001149: Hessian: proxy and chunked requests
Description (rep by Alon Salant)

We have found an issue with Hessian running through some proxy servers. The issue appears to be with using keep-alives to send chunked data.
 
Here are Hessian POST headers for a working call:
 
      HTTP: 1: POST /tops-services/remote/ContentManagerRemote HTTP/1.1
      HTTP: 2: Authorization: Basic NTcyMDA2L2NsZWFjaDpjbGVhY2gx
      HTTP: 3: Content-Type: text/xml
      HTTP: 4: User-Agent: Mozilla/4.0 (Windows 2000 5.0) Java/1.5.0_06
      HTTP: 5: Host: tops.taylorpub.com
      HTTP: 6: Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
      HTTP: 7: Connection: keep-alive
      HTTP: 8: Transfer-Encoding: chunked
      HTTP: 9: Cookie: JSESSIONID=aDLoOoVXfLj9c3TXRT
 
Here are Hessian POST headers for the failing call:
 
      HTTP: 1: POST http://tops.taylorpub.com/tops-services/remote/ContentManagerRemote [^] HTTP/1.1
      HTTP: 2: Authorization: Basic NTcyMDA2L2NsZWFjaDpjbGVhY2gx
      HTTP: 3: Content-Type: text/xml
      HTTP: 4: User-Agent: Mozilla/4.0 (Windows 2000 5.0) Java/1.5.0_06
      HTTP: 5: Host: tops.taylorpub.com
      HTTP: 6: Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
      HTTP: 7: Proxy-Connection: keep-alive
      HTTP: 8: Transfer-Encoding: chunked
      HTTP: 9: Cookie: JSESSIONID=a6ODB1JO8wDcjDtYRT
 
The only significant difference appears to be the ‘Connection: keep-alive’ v. ‘Proxy-Connection: keep-alive’ headers.
 
We used a network sniffer to inspect the packets being sent. In the working case, the following packets include chunked data. In the failing case, the server responds with a 400 Bad Request and the client throws an exception:
 
Caused by: java.io.IOException: Error writing request body to server
    at sun.net.www.protocol.http.HttpURLConnection$StreamingOutputStream.checkError(Unknown Source)
    at sun.net.www.protocol.http.HttpURLConnection$StreamingOutputStream.write(Unknown Source)
    at com.caucho.hessian.io.HessianOutput.writeBytes(HessianOutput.java:664)
 
 
Hessian on the server reports an exception:
 
com.caucho.hessian.io.HessianProtocolException: addContent: expected end of call ('z') at end of stream.
        at com.caucho.hessian.io.HessianInput.error(HessianInput.java:1640)
        at com.caucho.hessian.io.HessianInput.completeCall(HessianInput.java:259)
        at com.caucho.hessian.server.HessianSkeleton.invoke(HessianSkeleton.java:152)
        at org.springframework.remoting.caucho.HessianServiceExporter.handleRequest(HessianServiceExporter.java:87)
        ...
 
In the failing case it appears that Resin/Hessian think that the call is finished after the first chunk of the request is sent instead of waiting for the coming content as it does in the succeeding case.
 
My conclusion is that Resin/Hessian are not handling the ‘Proxy-Connection: keep-alive’ header correctly.
 
This is a fairly significant issue for us right now. I’d be happy to take some time to dig a bit deeper into the code if that would be helpful. Pointers on where to look would be appreciated. A fix would be appreciated even more J
 
Additional Information
Attached Files

- Relationships

- Notes
(0001342)
ferg
06-27-06 21:39

Added HessianProxyFactory.setChunkedPost, although the underlying problem for the above bug report was a misconfigured gateway.
 

- Issue History
Date Modified Username Field Change
05-26-06 13:14 ferg New Issue
06-27-06 21:39 ferg Note Added: 0001342
06-27-06 21:39 ferg Assigned To  => ferg
06-27-06 21:39 ferg Status new => closed
06-27-06 21:39 ferg Resolution open => fixed
06-27-06 21:39 ferg Fixed in Version  => 3.0.20


Mantis 1.0.0rc3[^]
Copyright © 2000 - 2005 Mantis Group
28 total queries executed.
25 unique queries executed.
Powered by Mantis Bugtracker