Ask a Question related to Ruby, Design and Development.
-
daz #1
[BUG] Net::HTTP closed stream (IOError)
Hi,
With this script on Win98se ...
printf("ruby %s (%s) [%s]\n", RUBY_VERSION, RUBY_RELEASE_DATE, RUBY_PLATFORM)
require 'net/http'
p [Net::HTTP::Revision, Net::HTTP::HTTPVersion]
h = Net::HTTP.new('www.rubyist.net')
resp = h.get('/index.html', nil) # line 10
puts resp.body
.... I get ...
ruby 1.8.0 (2003-08-30) [i586-bccwin32]
["1.97", "1.1"]
D:/RUBY/SRC_INST_2/lib/ruby/1.8/net/protocol.rb:92:in `close': closed stream (IOError)
from D:/RUBY/SRC_INST_2/lib/ruby/1.8/net/protocol.rb:92:in `close'
from D:/RUBY/SRC_INST_2/lib/ruby/1.8/net/http.rb:449:in `do_finish'
from D:/RUBY/SRC_INST_2/lib/ruby/1.8/net/http.rb:420:in `start'
from D:/RUBY/SRC_INST_2/lib/ruby/1.8/net/http.rb:822:in `request'
from D:/RUBY/SRC_INST_2/lib/ruby/1.8/net/http.rb:616:in `get'
from C:/TEMP/rb3205.TMP:7
If I rescue inside protocol.rb - InternetMessageIO#close ...
begin
p @socket
@socket.close
rescue => e # DfB
puts e.message
puts e.backtrace
end
....
ruby 1.8.0 (2003-08-30) [i586-bccwin32]
["1.97", "1.1"]
#<TCPSocket:0x313b4dc>
Unknown Error
D:/RUBY/SRC_INST_2/lib/ruby/1.8/net/protocol.rb:93:in `close'
D:/RUBY/SRC_INST_2/lib/ruby/1.8/net/protocol.rb:93:in `close'
D:/RUBY/SRC_INST_2/lib/ruby/1.8/net/http.rb:871:in `end_transport'
D:/RUBY/SRC_INST_2/lib/ruby/1.8/net/http.rb:836:in `request'
D:/RUBY/SRC_INST_2/lib/ruby/1.8/net/http.rb:821:in `request'
D:/RUBY/SRC_INST_2/lib/ruby/1.8/net/http.rb:819:in `start'
D:/RUBY/SRC_INST_2/lib/ruby/1.8/net/http.rb:822:in `request'
D:/RUBY/SRC_INST_2/lib/ruby/1.8/net/http.rb:616:in `get'
C:/TEMP/rb3205.TMP:7
"<html>\n<head>\n<title>www.rubyist.net</title>\n</head>\n<body>\n<p>\nHello world.\n</p>\n</body>\n"
.... the data is there, OK.
Any ideas ?
daz
daz Guest
-
#30329 [Opn->Fbk]: Error Fetching http body, No Content-Length, connection closed or chunked data
ID: 30329 Updated by: dmitry@php.net Reported By: thetaphi@php.net -Status: Open +Status: Feedback... -
#30329 [Csd->Opn]: Error Fetching http body, No Content-Length, connection closed or chunked data
ID: 30329 Updated by: lsmith@php.net Reported By: thetaphi@php.net -Status: Closed +Status: Open... -
#36515 [Asn->Csd]: stream_filter_append with zlib inflate filter on http stream crashes
ID: 36515 Updated by: pollita@php.net Reported By: mark at vectrex dot org dot uk -Status: Assigned +Status: ... -
XObject external stream over HTTP doesn't work with PDF-Library 6
Hello, want to add external JPEG files to PDF files with xobjects and external streams like described in the PDF reference... .... /FS /URL /F... -
"Cannot access a closed Stream" when using DimeAttachment
Hi all.. I'm trying to work with DimeAttachment. Please, take a look at code here - it's very simple to understand. Server Side: public class... -
daz #2
Re: [BUG] Net::HTTP closed stream (IOError)
resp = h.get('/index.html', nil) # line 7> resp = h.get('/index.html', nil) # line 10
daz Guest



Reply With Quote

