Software /
code /
prosody
Comparison
net/server_select.lua @ 3312:12fc7e005e8b
Merge 0.7->trunk
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Fri, 02 Jul 2010 17:44:14 +0100 |
parent | 3021:bf3c4195c5f8 |
parent | 3311:88cfe1bba690 |
child | 3382:fea0f8e19e4c |
comparison
equal
deleted
inserted
replaced
3308:f5243ca9662f | 3312:12fc7e005e8b |
---|---|
341 if handler then | 341 if handler then |
342 _writetimes[ handler ] = nil | 342 _writetimes[ handler ] = nil |
343 _closelist[ handler ] = nil | 343 _closelist[ handler ] = nil |
344 handler = nil | 344 handler = nil |
345 end | 345 end |
346 if server then | 346 if server then |
347 server.remove( ) | 347 server.remove( ) |
348 end | 348 end |
349 out_put "server.lua: closed client handler and removed socket from list" | 349 out_put "server.lua: closed client handler and removed socket from list" |
350 return true | 350 return true |
351 end | 351 end |
352 handler.ip = function( ) | 352 handler.ip = function( ) |
353 return ip | 353 return ip |
477 end | 477 end |
478 if succ then -- sending succesful | 478 if succ then -- sending succesful |
479 bufferqueuelen = 0 | 479 bufferqueuelen = 0 |
480 bufferlen = 0 | 480 bufferlen = 0 |
481 _sendlistlen = removesocket( _sendlist, socket, _sendlistlen ) -- delete socket from writelist | 481 _sendlistlen = removesocket( _sendlist, socket, _sendlistlen ) -- delete socket from writelist |
482 _ = needtls and handler:starttls(nil, true) | |
483 _writetimes[ handler ] = nil | 482 _writetimes[ handler ] = nil |
484 if drain then | 483 if drain then |
485 drain(handler) | 484 drain(handler) |
486 end | 485 end |
486 _ = needtls and handler:starttls(nil, true) | |
487 _ = toclose and handler:close( ) | 487 _ = toclose and handler:close( ) |
488 return true | 488 return true |
489 elseif byte and ( err == "timeout" or err == "wantwrite" ) then -- want write | 489 elseif byte and ( err == "timeout" or err == "wantwrite" ) then -- want write |
490 buffer = string_sub( buffer, byte + 1, bufferlen ) -- new buffer | 490 buffer = string_sub( buffer, byte + 1, bufferlen ) -- new buffer |
491 bufferqueue[ 1 ] = buffer -- insert new buffer in queue | 491 bufferqueue[ 1 ] = buffer -- insert new buffer in queue |