Changeset

564:779ab5b99e13

Don't say we need TLS after we've already started the handshake
author Matthew Wild <mwild1@gmail.com>
date Fri, 05 Dec 2008 19:40:46 +0000
parents 563:099d8a102deb
children 566:c83166927835
files net/server.lua
diffstat 1 files changed, 1 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/net/server.lua	Fri Dec 05 19:24:01 2008 +0000
+++ b/net/server.lua	Fri Dec 05 19:40:46 2008 +0000
@@ -470,9 +470,6 @@
 			if handler.need_tls then
 				out_put("server.lua: connection is ready for tls handshake");
 				handler.starttls(true);
-				if handler.need_tls then
-					out_put("server.lua: uh-oh... we still want tls, something must be wrong");
-				end
 			end
 			return true
 		elseif byte and ( err == "timeout" or err == "wantwrite" ) then    -- want write
@@ -536,6 +533,7 @@
 		end
 		
 		handler.starttls = nil;
+		handler.need_tls = nil
 		
 			handler.handshake = coroutine_wrap( function( client )
 					local err
@@ -546,7 +544,6 @@
 							writelen = ( wrote and removesocket( writelist, socket, writelen ) ) or writelen
 							handler.receivedata = handler._receivedata    -- when handshake is done, replace the handshake function with regular functions
 							handler.dispatchdata = handler._dispatchdata
-							handler.need_tls = nil
 							return true;
 						else
 							out_put( "server.lua: error during ssl handshake: ", err )