[#2529] concerns about Proc,lambda,block — "David A. Black" <dblack@...>

Hi --

39 messages 2004/03/01
[#2531] Re: concerns about Proc,lambda,block — ts <decoux@...> 2004/03/01

>>>>> "D" == David A Black <dblack@wobblini.net> writes:

[#2533] Re: concerns about Proc,lambda,block — "David A. Black" <dblack@...> 2004/03/01

Hi --

[#2537] Re: concerns about Proc,lambda,block — matz@... (Yukihiro Matsumoto) 2004/03/01

Hi,

[#2542] Re: concerns about Proc,lambda,block — Mathieu Bouchard <matju@...> 2004/03/02

[#2545] Re: concerns about Proc,lambda,block — matz@... (Yukihiro Matsumoto) 2004/03/02

Hi,

[#2550] Re: concerns about Proc,lambda,block — Mauricio Fern疣dez <batsman.geo@...> 2004/03/03

On Wed, Mar 03, 2004 at 07:51:10AM +0900, Yukihiro Matsumoto wrote:

[#2703] Proposed patch to add SSL support to net/pop.rb — Daniel Hobe <daniel@...>

This patch adds support to Net::POP for doing POP over SSL. Modeled on how

19 messages 2004/03/27
[#2704] Re: Proposed patch to add SSL support to net/pop.rb — Daniel Hobe <daniel@...> 2004/03/27

This is v2 of the patch. Cleaned up a bit and added some more docs.

[#2707] Re: Proposed patch to add SSL support to net/pop.rb — Daniel Hobe <daniel@...> 2004/03/28

v3 of the patch:

[#2721] Re: Proposed patch to add SSL support to net/pop.rb — Minero Aoki <aamine@...> 2004/03/30

Hi,

Re: problem with Net::HTTP in 1.8.1

From: nobu.nokada@...
Date: 2004-03-05 00:10:06 UTC
List: ruby-core #2578
Hi,

At Fri, 5 Mar 2004 08:53:38 +0900,
Ian Macdonald wrote in [ruby-core:02577]:
> The following code seems to cause an infinite loop:
> 
>   #!/usr/bin/ruby -w
>   
>   require 'net/http'
>   
>   http = Net::HTTP.start('www.google.com', 80)
>   
>   response = http.get('/')
>   puts response.header
> 
> 
> This causes the following bogus message to be printed indefinitely:
> 
> net/http.rb: warning: Net::HTTP v1.1 style assignment found at ./foo:8:in `puts'; use `response = http.get(...)' instead.

HTTPResponse#to_ary returns an array contains itself, and #puts
tries to traverse it and causes infinite recursion.

In the meantime, the following patch could get rid of the
problem.


Index: lib/net/http.rb
===================================================================
RCS file: /cvs/ruby/src/ruby/lib/net/http.rb,v
retrieving revision 1.105
diff -u -2 -p -d -r1.105 http.rb
--- lib/net/http.rb	8 Feb 2004 05:24:47 -0000	1.105
+++ lib/net/http.rb	5 Mar 2004 00:00:28 -0000
@@ -1608,5 +1608,9 @@ module Net # :nodoc:
     def to_ary
       warn "net/http.rb: warning: Net::HTTP v1.1 style assignment found at #{caller(1)[0]}; use `response = http.get(...)' instead." if $VERBOSE
-      [self, body()]
+      resp = self.dup
+      class << resp
+        undef to_ary
+      end
+      [resp, body()]
     end
 


-- 
Nobu Nakada

In This Thread