Software /
code /
prosody
Comparison
net/server.lua @ 1953:64538c620450
Merge with 0.5
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Wed, 14 Oct 2009 14:12:14 +0100 |
parent | 1886:d19c0a21bfb6 |
parent | 1952:4a15b176fca8 |
child | 1979:52ddaa2e6ab8 |
comparison
equal
deleted
inserted
replaced
1950:a1d186c8c65a | 1953:64538c620450 |
---|---|
369 end | 369 end |
370 else | 370 else |
371 send( socket, table_concat( bufferqueue, "", 1, bufferqueuelen ), 1, bufferlen ) -- forced send | 371 send( socket, table_concat( bufferqueue, "", 1, bufferqueuelen ), 1, bufferlen ) -- forced send |
372 end | 372 end |
373 end | 373 end |
374 if not handler then return true; end | 374 if socket then |
375 _ = shutdown and shutdown( socket ) | 375 _ = shutdown and shutdown( socket ) |
376 socket:close( ) | 376 socket:close( ) |
377 _sendlistlen = removesocket( _sendlist, socket, _sendlistlen ) | 377 _sendlistlen = removesocket( _sendlist, socket, _sendlistlen ) |
378 _socketlist[ socket ] = nil | 378 _socketlist[ socket ] = nil |
379 socket = nil | |
380 else | |
381 out_put "server.lua: socket already closed" | |
382 end | |
379 if handler then | 383 if handler then |
380 _writetimes[ handler ] = nil | 384 _writetimes[ handler ] = nil |
381 _closelist[ handler ] = nil | 385 _closelist[ handler ] = nil |
382 handler = nil | 386 handler = nil |
383 end | 387 end |
384 socket = nil | |
385 --mem_free( ) | |
386 if server then | 388 if server then |
387 server.remove( ) | 389 server.remove( ) |
388 end | 390 end |
389 out_put "server.lua: closed client handler and removed socket from list" | 391 out_put "server.lua: closed client handler and removed socket from list" |
390 return true | 392 return true |