[Pkg-puppet-devel] [SCM] Puppet packaging for Debian branch, upstream, updated. puppet-0.24.5-rc3-1456-g2f0b1e5

James Turnbull james at lovedthanlost.net
Tue Oct 27 17:04:55 UTC 2009


The following commit has been merged in the upstream branch:
commit f5a106dd61947146138148f64967122a4c9021d1
Author: Markus Roberts <Markus at reality.com>
Date:   Mon Sep 14 17:03:41 2009 -0700

    Fix for #2637 (Webrick accpting connections on dead sockets)
    
    There was a race condition between the layers (SSL vs. TCP/IP) that
    permitted the creation of non-functional connections when webrick
    managed the connection.  This patch moves the responsibility into
    our code via the provided callbacks and makes sure the socket is
    valid before accepting the connection.
    
    Signed-off-by: Markus Roberts <Markus at reality.com>

diff --git a/lib/puppet/network/http/webrick.rb b/lib/puppet/network/http/webrick.rb
index a60a22b..bf4bf88 100644
--- a/lib/puppet/network/http/webrick.rb
+++ b/lib/puppet/network/http/webrick.rb
@@ -31,13 +31,20 @@ class Puppet::Network::HTTP::WEBrick
         arguments.merge!(setup_ssl)
 
         @server = WEBrick::HTTPServer.new(arguments)
+        @server.listeners.each { |l| l.start_immediately = false }
 
         setup_handlers
 
         @mutex.synchronize do
             raise "WEBrick server is already listening" if @listening
             @listening = true
-            @thread = Thread.new { @server.start }
+            @thread = Thread.new {
+                @server.start { |sock|
+                    raise "Client disconnected before connection could be established" unless IO.select([sock],nil,nil,0.1)
+                    sock.accept
+                    @server.run(sock)
+                }
+           }
         end
     end
 

-- 
Puppet packaging for Debian



More information about the Pkg-puppet-devel mailing list