[BUG] Net::HTTP closed stream (IOError)

Ask a Question related to Ruby, Design and Development.

  1. #1

    Default [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

  2. Similar Questions and Discussions

    1. #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...
    2. #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...
    3. #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: ...
    4. 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...
    5. "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...
  3. #2

    Default Re: [BUG] Net::HTTP closed stream (IOError)

    > resp = h.get('/index.html', nil) # line 10
    resp = h.get('/index.html', nil) # line 7



    daz Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139