Changeset

770:bddf52121908

Fix for nil handler error after close
author Matthew Wild <mwild1@gmail.com>
date Wed, 04 Feb 2009 18:53:56 +0000
parents 769:9e76018c62fa
children 771:ecdf72f9b085 777:f7a87acea220
files net/server.lua
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
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