Software /
code /
prosody
Comparison
net/server.lua @ 562:04ee161d936b
Comment out debug logging for now
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Fri, 05 Dec 2008 19:22:34 +0000 |
parent | 561:e2a88796cdce |
child | 563:099d8a102deb |
comparison
equal
deleted
inserted
replaced
561:e2a88796cdce | 562:04ee161d936b |
---|---|
263 if not err or ( err == "timeout" or err == "wantread" ) then -- received something | 263 if not err or ( err == "timeout" or err == "wantread" ) then -- received something |
264 local data = data or part or "" | 264 local data = data or part or "" |
265 local count = #data * STAT_UNIT | 265 local count = #data * STAT_UNIT |
266 rstat = rstat + count | 266 rstat = rstat + count |
267 receivestat = receivestat + count | 267 receivestat = receivestat + count |
268 out_put( "server.lua: read data '", data, "', error: ", err ) | 268 --out_put( "server.lua: read data '", data, "', error: ", err ) |
269 return dispatch( handler, data, err ) | 269 return dispatch( handler, data, err ) |
270 else -- connections was closed or fatal error | 270 else -- connections was closed or fatal error |
271 out_put( "server.lua: client ", ip, ":", clientport, " error: ", err ) | 271 out_put( "server.lua: client ", ip, ":", clientport, " error: ", err ) |
272 handler.close( ) | 272 handler.close( ) |
273 disconnect( handler, err ) | 273 disconnect( handler, err ) |
560 return false -- handshake failed | 560 return false -- handshake failed |
561 end | 561 end |
562 ) | 562 ) |
563 handler.receivedata = handler.handshake | 563 handler.receivedata = handler.handshake |
564 handler.dispatchdata = handler.handshake | 564 handler.dispatchdata = handler.handshake |
565 | 565 |
566 handler.handshake( socket ) -- do handshake | 566 handler.handshake( socket ) -- do handshake |
567 end | 567 end |
568 socketlist[ socket ] = handler | 568 socketlist[ socket ] = handler |
569 readlen = readlen + 1 | 569 readlen = readlen + 1 |
570 readlist[ readlen ] = socket | 570 readlist[ readlen ] = socket |
656 if not err or ( err == "timeout" or err == "wantread" ) then -- received something | 656 if not err or ( err == "timeout" or err == "wantread" ) then -- received something |
657 local data = data or part or "" | 657 local data = data or part or "" |
658 local count = #data * STAT_UNIT | 658 local count = #data * STAT_UNIT |
659 rstat = rstat + count | 659 rstat = rstat + count |
660 receivestat = receivestat + count | 660 receivestat = receivestat + count |
661 out_put( "server.lua: read data '", data, "', error: ", err ) | 661 --out_put( "server.lua: read data '", data, "', error: ", err ) |
662 return dispatch( handler, data, err ) | 662 return dispatch( handler, data, err ) |
663 else -- connections was closed or fatal error | 663 else -- connections was closed or fatal error |
664 out_put( "server.lua: client ", ip, ":", clientport, " error: ", err ) | 664 out_put( "server.lua: client ", ip, ":", clientport, " error: ", err ) |
665 handler.close( ) | 665 handler.close( ) |
666 disconnect( handler, err ) | 666 disconnect( handler, err ) |