Software /
code /
prosody
Comparison
net/server_event.lua @ 2124:465a7481ab96
net.server_event: Remove premature non-optimisation
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Sun, 22 Nov 2009 04:06:40 +0000 |
parent | 2123:f7b589f798af |
child | 2125:2b4f8a35e41a |
comparison
equal
deleted
inserted
replaced
2123:f7b589f798af | 2124:465a7481ab96 |
---|---|
514 interface.eventwrite = nil | 514 interface.eventwrite = nil |
515 return -1 | 515 return -1 |
516 end | 516 end |
517 end | 517 end |
518 end | 518 end |
519 local usingssl, receive = interface._usingssl, interface.receive; | 519 |
520 interface.readcallback = function( event ) -- called on read events | 520 interface.readcallback = function( event ) -- called on read events |
521 --vdebug( "new client read event, id/ip/port:", interface, ip, port ) | 521 --vdebug( "new client read event, id/ip/port:", interface, ip, port ) |
522 if interface.noreading or interface.fatalerror then -- leave this event | 522 if interface.noreading or interface.fatalerror then -- leave this event |
523 --vdebug( "leaving this event because:", interface.noreading or interface.fatalerror ) | 523 --vdebug( "leaving this event because:", interface.noreading or interface.fatalerror ) |
524 interface.eventread = nil | 524 interface.eventread = nil |
529 debug( "connection failed:", interface.fatalerror ) | 529 debug( "connection failed:", interface.fatalerror ) |
530 interface:_close() | 530 interface:_close() |
531 interface.eventread = nil | 531 interface.eventread = nil |
532 return -1 | 532 return -1 |
533 else -- can read | 533 else -- can read |
534 if usingssl then -- handle luasec | 534 if interface._usingssl then -- handle luasec |
535 if interface.eventwritetimeout then -- ok, in the past writecallback was regged | 535 if interface.eventwritetimeout then -- ok, in the past writecallback was regged |
536 local ret = interface.writecallback( ) -- call it | 536 local ret = interface.writecallback( ) -- call it |
537 --vdebug( "tried to write in readcallback, result:", ret ) | 537 --vdebug( "tried to write in readcallback, result:", ret ) |
538 end | 538 end |
539 if interface.eventreadtimeout then | 539 if interface.eventreadtimeout then |