Bug #969
closedEOFError when doing net/http post with large body
Description
=begin
Official Ruby 1.8.7-i386-mswin32 binary.
Running Windows Vista SP1 64-bit.
When performing an HTTP post using net/http, and a body under 23,400 bytes, I get a response from the server. When over 23,500 bytes, I get the following error:
C:\Users\tim\Desktop\ruby\bin>ruby ../../cr.rb
C:/Users/tim/Desktop/ruby/lib/ruby/1.8/uri.rb:16: warning: already initialized constant VERSION_CODE
C:/Users/tim/Desktop/ruby/lib/ruby/1.8/uri.rb:17: warning: already initialized constant VERSION
C:/Users/tim/Desktop/ruby/lib/ruby/1.8/net/protocol.rb:135:in sysread': end of file reached (EOFError) from C:/Users/tim/Desktop/ruby/lib/ruby/1.8/net/protocol.rb:135:in
rbuf_fill'
from C:/Users/tim/Desktop/ruby/lib/ruby/1.8/timeout.rb:62:in timeout' from C:/Users/tim/Desktop/ruby/lib/ruby/1.8/timeout.rb:93:in
timeout'
from C:/Users/tim/Desktop/ruby/lib/ruby/1.8/net/protocol.rb:134:in rbuf_fill' from C:/Users/tim/Desktop/ruby/lib/ruby/1.8/net/protocol.rb:116:in
read until'
from C:/Users/tim/Desktop/ruby/lib/ruby/1.8/net/protocol.rb:126:in readline' from C:/Users/tim/Desktop/ruby/lib/ruby/1.8/net/http.rb:2020:in
read_status_line'
from C:/Users/tim/Desktop/ruby/lib/ruby/1.8/net/http.rb:2009:in read_new' from C:/Users/tim/Desktop/ruby/lib/ruby/1.8/net/http.rb:1050:in
request'
from ../../cr.rb:11
from C:/Users/tim/Desktop/ruby/lib/ruby/1.8/net/http.rb:543:in `start'
from ../../cr.rb:11
The above error message is triggered with the following script:
require 'URI'
require 'net/http'
body_string = 'a' * 23500
url = 'http://google.com'
uri = URI.parse url
http = Net::HTTP.new uri.host, uri.port
req = Net::HTTP::Post.new uri.request_uri
req.body = body_string
response = http.start{|conn| conn.request req}
puts response.body
=end
Files
Updated by ko1 (Koichi Sasada) about 15 years ago
- Assignee set to aamine (Minero Aoki)
- ruby -v set to Official Ruby 1.8.7-i386-mswin32 binary.
=begin
=end
Updated by nahi (Hiroshi Nakamura) over 13 years ago
- Assignee changed from aamine (Minero Aoki) to nahi (Hiroshi Nakamura)
=begin
=end
Updated by nahi (Hiroshi Nakamura) over 13 years ago
- Category set to core
- Status changed from Open to Rejected
=begin
Sorry for late reply. I cannot reproduce the error with 'ruby 1.8.7 (2010-08-16 patchlevel 302) [i386-mswin32]'
and 'ruby 1.9.2p0 (2010-08-18 revision 29036) [i386-mswin32]'.
I close this as 'Rejected' as 'Works for me' since the ticket is a little bit aged.
Feel free to reopen this. Thanks.
PS. As far as I know, there's no 'Official' bin for Windows port.
=end