Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > Exception change with net/http in Ruby 187 PL 248/9

Reply
Thread Tools

Exception change with net/http in Ruby 187 PL 248/9

 
 
Mitch Williams
Guest
Posts: n/a
 
      02-18-2010
Ran into the following problem with net http in Ruby 187 pl248

require net/http.rb
n =3D Net::HTTP.new('server-that-is-not-listening-on-port-eighty')
n.request_head('/')

Prior to this change:
http://svn.ruby-lang.org/cgi-bin/vie...vision=3D25851 the
above code results in an:

Errno::ECONNREFUSED: Connection refused - connect(2)


After the change I receive:

NoMethodError: undefined method `closed?' for nil:NilClass


From line 1060 of net/http.rb. It looks like the code was intended to clos=
e
sockets in the event of an error, but it assumes the socket actually exists=
 
Reply With Quote
 
 
 
 
hemant
Guest
Posts: n/a
 
      02-18-2010
Hi,

On Thu, Feb 18, 2010 at 6:19 AM, Mitch Williams <(E-Mail Removed)> wrot=
e:
> Ran into the following problem with net http in Ruby 187 pl248
>
> require net/http.rb
> n =3D Net::HTTP.new('server-that-is-not-listening-on-port-eighty')
> n.request_head('/')
>
> Prior to this change:
> http://svn.ruby-lang.org/cgi-bin/vie...vision=3D25851 t=

he
> above code results in an:
>
> Errno::ECONNREFUSED: Connection refused - connect(2)
>
>
> After the change I receive:
>
> NoMethodError: undefined method `closed?' for nil:NilClass
>
>
> From line 1060 of net/http.rb. =A0It looks like the code was intended to =

close
> sockets in the event of an error, but it assumes the socket actually exis=

ts.
>
> Can anyone else reproduce this issue?
>


Yes, I can reproduce.

Indeed, this looks like unintentional change to me and somewhat
unintuitive. I think, you should file a report on Redmine for this or
raise it on ruby-core mailing list.

 
Reply With Quote
 
 
 
 
Mitch Williams
Guest
Posts: n/a
 
      02-18-2010
Thanks for taking the time to respond Hemant.

I've added a redmine ticket for it here
http://redmine.ruby-lang.org/issues/show/2758

On Thu, Feb 18, 2010 at 6:20 AM, hemant <(E-Mail Removed)> wrote:

> Hi,
>
> On Thu, Feb 18, 2010 at 6:19 AM, Mitch Williams <(E-Mail Removed)>
> wrote:
> > Ran into the following problem with net http in Ruby 187 pl248
> >
> > require net/http.rb
> > n =3D Net::HTTP.new('server-that-is-not-listening-on-port-eighty')
> > n.request_head('/')
> >
> > Prior to this change:
> > http://svn.ruby-lang.org/cgi-bin/vie...ision=3D25851=

the
> > above code results in an:
> >
> > Errno::ECONNREFUSED: Connection refused - connect(2)
> >
> >
> > After the change I receive:
> >
> > NoMethodError: undefined method `closed?' for nil:NilClass
> >
> >
> > From line 1060 of net/http.rb. It looks like the code was intended to

> close
> > sockets in the event of an error, but it assumes the socket actually

> exists.
> >
> > Can anyone else reproduce this issue?
> >

>
> Yes, I can reproduce.
>
> Indeed, this looks like unintentional change to me and somewhat
> unintuitive. I think, you should file a report on Redmine for this or
> raise it on ruby-core mailing list.
>
>



--=20
+ Mitch Williams
+ Software Engineer
+ Socialcast=AE

+ 19 South Park
+ San Francisco, CA 94107

+ e: http://www.velocityreviews.com/forums/(E-Mail Removed)

+ p: 651.964.8521
+ f: 801.348.4750

This e-mail may be privileged and/or confidential, and the sender does not
waive any related rights and obligations. Any distribution, use or copying
of this e-mail or the information it contains by other than an intended
recipient is unauthorized. If you are unsure why this e-mail was sent to
you, please advise me (by return e-mail or otherwise) immediately.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Want to get the latest 187 dll Hr Ro Ruby 0 08-23-2009 05:04 PM
[QUIZ] Dreaming of a Ruby Christmas (#187) Matthew Moss Ruby 9 12-25-2008 05:12 PM
Rural laptop to cost $187, with Linux Au79 Computer Support 4 03-19-2006 06:14 AM
XML::Generator::DBI - use of uninitialized value on line 180 and 187 Radhika Perl Misc 0 09-13-2004 02:00 AM
**>> Speed UP 187%(ave.) Your Computer Kirk Gregory Czuhai Computer Information 2 08-18-2004 08:34 PM



Advertisments