Comparison

net/server_select.lua @ 3458:9c3ae41e696c

net.server_select, net.server_event: Remove set_mode() call from server.link()... it can cause the last chunk of data to be discarded if shorter than buffersize (thanks to Zash for the debugging)
author Matthew Wild <mwild1@gmail.com>
date Sun, 22 Aug 2010 21:12:22 +0100
parent 3398:abc4a52aef02
child 3491:e8c06d20a18b
comparison
equal deleted inserted replaced
3457:24d2c9be0149 3458:9c3ae41e696c
664 socket:close( ) 664 socket:close( )
665 --mem_free( ) 665 --mem_free( )
666 end 666 end
667 667
668 local function link(sender, receiver, buffersize) 668 local function link(sender, receiver, buffersize)
669 sender:set_mode(buffersize);
670 local sender_locked; 669 local sender_locked;
671 local _sendbuffer = receiver.sendbuffer; 670 local _sendbuffer = receiver.sendbuffer;
672 function receiver.sendbuffer() 671 function receiver.sendbuffer()
673 _sendbuffer(); 672 _sendbuffer();
674 if sender_locked and receiver.bufferlen() < buffersize then 673 if sender_locked and receiver.bufferlen() < buffersize then