From e926425cfb886b3ef90ca4f2ee6cd5e171596ad5 Mon Sep 17 00:00:00 2001 From: Jamie Cameron Date: Tue, 28 Jun 2011 00:07:23 -0400 Subject: [PATCH] Close main socket before SSL init, to prevent hangs (I hope) --- miniserv.pl | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/miniserv.pl b/miniserv.pl index 8c95226b0..24081f8a1 100755 --- a/miniserv.pl +++ b/miniserv.pl @@ -879,13 +879,6 @@ while(1) { $SIG{'HUP'} = 'IGNORE'; $SIG{'USR1'} = 'IGNORE'; - # Initialize SSL for this connection - if ($use_ssl) { - $ssl_con = &ssl_connection_for_ip( - SOCK, $ipv6fhs{$s}); - $ssl_con || exit; - } - # Close the file handle for the session DBM dbmclose(%sessiondb); @@ -897,6 +890,13 @@ while(1) { &close_all_sockets(); close(LISTEN); + # Initialize SSL for this connection + if ($use_ssl) { + $ssl_con = &ssl_connection_for_ip( + SOCK, $ipv6fhs{$s}); + $ssl_con || exit; + } + print DEBUG "main: Starting handle_request loop pid=$$\n"; while(&handle_request($peera, $locala,