--Apple-Mail-6-915336274
Content-Transfer-Encoding: 7bit
Content-Type: text/plain;
	charset-ASCII;
	formatðïwed

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:


--Apple-Mail-6-915336274
Content-Transfer-Encoding: 7bit
Content-Type: application/octet-stream;
	x-unix-mode44;
	namesl.rb.close.patch"
Content-Disposition: attachment;
	filenamel.rb.close.patch

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

--Apple-Mail-6-915336274
Content-Transfer-Encoding: 7bit
Content-Type: text/plain;
	charset-ASCII;
	formatðïwed


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

http://trackmap.robotcoop.com



--Apple-Mail-6-915336274--