Software /
code /
prosody
Comparison
net/server.lua @ 815:cf8392613f46
net.server: Fix some more potential nil handler accesses
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Wed, 18 Feb 2009 19:23:29 +0000 |
parent | 775:d4b6714fc829 |
child | 846:77244ba297ac |
comparison
equal
deleted
inserted
replaced
814:f12b1ddd458d | 815:cf8392613f46 |
---|---|
367 _sendlist[ _sendlistlen ] = socket | 367 _sendlist[ _sendlistlen ] = socket |
368 _sendlist[ socket ] = _sendlistlen | 368 _sendlist[ socket ] = _sendlistlen |
369 end | 369 end |
370 bufferqueuelen = bufferqueuelen + 1 | 370 bufferqueuelen = bufferqueuelen + 1 |
371 bufferqueue[ bufferqueuelen ] = data | 371 bufferqueue[ bufferqueuelen ] = data |
372 _writetimes[ handler ] = _writetimes[ handler ] or _currenttime | 372 if handler then |
373 _writetimes[ handler ] = _writetimes[ handler ] or _currenttime | |
374 end | |
373 return true | 375 return true |
374 end | 376 end |
375 handler.write = write | 377 handler.write = write |
376 handler.bufferqueue = function( ) | 378 handler.bufferqueue = function( ) |
377 return bufferqueue | 379 return bufferqueue |
468 return true | 470 return true |
469 else -- connection was closed during sending or fatal error | 471 else -- connection was closed during sending or fatal error |
470 out_put( "server.lua: client ", ip, ":", clientport, " error: ", err ) | 472 out_put( "server.lua: client ", ip, ":", clientport, " error: ", err ) |
471 fatalerror = true | 473 fatalerror = true |
472 disconnect( handler, err ) | 474 disconnect( handler, err ) |
473 handler.close( ) | 475 _ = handler and handler.close( ) |
474 return false | 476 return false |
475 end | 477 end |
476 end | 478 end |
477 | 479 |
478 if sslctx then -- ssl? | 480 if sslctx then -- ssl? |