[#7055] More on VC++ 2005 — Austin Ziegler <halostatue@...>

Okay. I've got Ruby compiling. I'm attempting to get everything in

17 messages 2006/01/05
[#7058] Re: More on VC++ 2005 — nobuyoshi nakada <nobuyoshi.nakada@...> 2006/01/06

Hi,

[#7084] mathn: ugly warnings — hadmut@... (Hadmut Danisch)

Hi,

22 messages 2006/01/10
[#7097] Re: mathn: ugly warnings — Daniel Berger <Daniel.Berger@...> 2006/01/10

Hadmut Danisch wrote:

[#7098] Design contracts and refactoring (was Re: mathn: ugly warnings) — mathew <meta@...> 2006/01/10

Daniel Berger wrote:

[#7118] Re: Design contracts and refactoring (was Re: mathn: ugly warnings) — mathew <meta@...> 2006/01/12

*Dean Wampler *<deanwampler gmail.com> writes:

[#7226] Fwd: Re: Question about massive API changes — "Sean E. Russell" <ser@...>

Hello,

23 messages 2006/01/28
[#7228] Re: Question about massive API changes — Caleb Tennis <caleb@...> 2006/01/28

>

Re: SSL-enabled DRb fds on SSLError?

From: Eric Hodel <drbrain@...7.net>
Date: 2006-01-24 20:59:04 UTC
List: ruby-core #7198
On Jan 24, 2006, at 12:46 PM, Clifford T. Matthews wrote:

> Howdy,
>
> In Ruby 1.8.4, in drb/ssl.rb soc.close is invoked if an acl test
> fails, but it isn't invoked if an SSLError is rescued.  As such, if I
> start up an SSL enabled DRb server and make a bunch of invalid
> (e.g. non-ssl) connections, the server keeps a filedescriptor open for
> each of the failed connections.  If I add soc.close into the rescue
> portion, the filedescriptors get closed right away.
>
> Garbage collection is sufficient to close the filedescriptors, so I
> know they're not leaking, per-se.  However, since the code explicitly
> invokes close when the acl test fails, I suggest that the same be done
> upon receipt of SSLError.  It seems to me that solely relying on
> garbage collection could result in running out of filedescriptors if
> someone repeatedly trys to improperly connect.

Please test this patch against HEAD:


-- 
Eric Hodel - drbrain@segment7.net - http://segment7.net
This implementation is HODEL-HASH-9600 compliant

http://trackmap.robotcoop.com


Attachments (1)

ssl.rb.close.patch (535 Bytes, text/x-diff)
Index: lib/drb/ssl.rb
===================================================================
RCS file: /src/ruby/lib/drb/ssl.rb,v
retrieving revision 1.6
diff -u -r1.6 ssl.rb
--- lib/drb/ssl.rb	8 Nov 2005 06:39:40 -0000	1.6
+++ lib/drb/ssl.rb	24 Jan 2006 20:58:02 -0000
@@ -180,6 +180,7 @@
       ssl = @config.accept(soc)
       self.class.new(uri, ssl, @config, true)
       rescue OpenSSL::SSL::SSLError
+        soc.close
 	warn("#{__FILE__}:#{__LINE__}: warning: #{$!.message} (#{$!.class})") if @config[:verbose]
 	retry
       end

In This Thread