Software /
code /
prosody
Comparison
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 |
comparison
equal
deleted
inserted
replaced
769:9e76018c62fa | 770:bddf52121908 |
---|---|
454 if succ then -- sending succesful | 454 if succ then -- sending succesful |
455 bufferqueuelen = 0 | 455 bufferqueuelen = 0 |
456 bufferlen = 0 | 456 bufferlen = 0 |
457 _sendlistlen = removesocket( _sendlist, socket, _sendlistlen ) -- delete socket from writelist | 457 _sendlistlen = removesocket( _sendlist, socket, _sendlistlen ) -- delete socket from writelist |
458 _ = needtls and handler.starttls(true) | 458 _ = needtls and handler.starttls(true) |
459 _writetimes[ handler ] = nil | |
459 _ = toclose and handler.close( ) | 460 _ = toclose and handler.close( ) |
460 _writetimes[ handler ] = nil | |
461 return true | 461 return true |
462 elseif byte and ( err == "timeout" or err == "wantwrite" ) then -- want write | 462 elseif byte and ( err == "timeout" or err == "wantwrite" ) then -- want write |
463 buffer = string_sub( buffer, byte + 1, bufferlen ) -- new buffer | 463 buffer = string_sub( buffer, byte + 1, bufferlen ) -- new buffer |
464 bufferqueue[ 1 ] = buffer -- insert new buffer in queue | 464 bufferqueue[ 1 ] = buffer -- insert new buffer in queue |
465 bufferqueuelen = 1 | 465 bufferqueuelen = 1 |