Diff

net/server.lua @ 770:bddf52121908

Fix for nil handler error after close
author Matthew Wild <mwild1@gmail.com>
date Wed, 04 Feb 2009 18:53:56 +0000
parent 741:97577b6c07ca
child 773:c36edc1934c5
line wrap: on
line diff
--- a/net/server.lua	Wed Feb 04 18:53:23 2009 +0000
+++ b/net/server.lua	Wed Feb 04 18:53:56 2009 +0000
@@ -456,8 +456,8 @@
             bufferlen = 0
             _sendlistlen = removesocket( _sendlist, socket, _sendlistlen )    -- delete socket from writelist
             _ = needtls and handler.starttls(true)
+            _writetimes[ handler ] = nil
 	    _ = toclose and handler.close( )
-            _writetimes[ handler ] = nil
             return true
         elseif byte and ( err == "timeout" or err == "wantwrite" ) then    -- want write
             buffer = string_sub( buffer, byte + 1, bufferlen )    -- new buffer