rbuf_fill': End of file reached (EOFError)
------------------------------------------

                 Key: JRUBY-4826
                 URL: http://jira.codehaus.org/browse/JRUBY-4826
             Project: JRuby
          Issue Type: Bug
    Affects Versions: JRuby 1.5, JRuby 1.4, JRuby-OpenSSL 0.7
            Reporter: Reto Schüttel
            Assignee: Thomas E Enebo


In certain situations net/http and jruby-openssl fail to correctly read a 
GET/POST's response. Switchting to MRI or to http usually makes the problem 
disappear.

In my case I think I was able to reduce it to the following script:

{code} 
require 'net/https'
http = Net::HTTP.new("bounty.schuettel.ch", 443)
http.use_ssl = true

http.start do |http|
  req = Net::HTTP::Post.new("/jruby-openssl/")
  response = http.request(req)
  resp = response.body
  puts resp.inspect
end
{code} 

JRuby aborts with the following error:

{code}
% jruby test.rb 
warning: peer certificate won't be verified in this SSL session
/opt/jruby/lib/ruby/1.8/net/protocol.rb:135:in `rbuf_fill': End of file reached 
(EOFError)
        from /opt/jruby/lib/ruby/1.8/net/protocol.rb:134:in `rbuf_fill'
        from /opt/jruby/lib/ruby/1.8/net/protocol.rb:86:in `read'
        from /opt/jruby/lib/ruby/1.8/net/http.rb:2237:in `read_chunked'
        from /opt/jruby/lib/ruby/1.8/net/http.rb:2211:in `read_body_0'
        from /opt/jruby/lib/ruby/1.8/net/http.rb:2177:in `read_body'
        from /opt/jruby/lib/ruby/1.8/net/http.rb:2202:in `body'
        from /opt/jruby/lib/ruby/1.8/net/http.rb:2141:in `reading_body'
        from /opt/jruby/lib/ruby/1.8/net/http.rb:1052:in `request'
        from test.rb:7
        from /opt/jruby/lib/ruby/1.8/net/http.rb:543:in `start'
        from test.rb:5
{code}

Normal MRI has no troubles with it.

I was only to trigger the problem with the chunked transfer encoding 
(Transfer-Encoding: chunked). The exact response of above's url is:

{code}
HTTP/1.1 500 Internal Server Error
Date: Wed, 26 May 2010 17:54:34 GMT
Server: Apache-Coyote/1.1
Content-Type: text/xml;charset=utf-8
Connection: close
Transfer-Encoding: chunked

1cb
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"; 
xmlns:xsd="http://www.w3.org/2001/XMLSchema"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>
 <soapenv:Body>
  <soapenv:Fault>
   <faultcode 
xmlns:ns1="http://xml.apache.org/axis/";>ns1:Client.NoSOAPAction</faultcode>
   <faultstring>no SOAPAction header!</faultstring>
   <detail/>
  </soapenv:Fault>
 </soapenv:Body>
</soapenv:Envelope>
0
{code}

I guess there might be a problem with this empty '0' chunk. 

Feel free to use above's script and service on bounty.schuettel.ch to work on 
this problem, I will be able to keep it running for a while.

This problem has been reported before in other tickets, some of them got closed 
due to incompletness:

 * http://jira.codehaus.org/browse/JRUBY-4822
 * http://jira.codehaus.org/browse/JRUBY-4391
 * http://jira.codehaus.org/browse/JRUBY-2860

Thanks for your help!

Cheers,
Reto


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira



---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to