src/sbbs3 js_socket.c 1.178 1.179
Update of /cvsroot/sbbs/src/sbbs3
In directory cvs:/tmp/cvs-serv25911
Modified Files:
js_socket.c
Log Message:
Fix socket.send() so that it returns the number of bytes sent. The
underlying send() function is free to send a subset of the bytes, and occasionally does (especially on non-blocking sockets). The return value
was true if all bytes were sent or false if not all bytes were sent.
The new behaviour is to return the number of bytes sent or null on failure.
This is mostly compatible with existing code which appears to universally use if (!sock.send(str))
Cases where it's not compatible are when a zero-length string is sent. The handling of errors is slightly different now too... previously, if you retransmitted on failure, the stream would "stutter" now it will have
"holes".
---
þ Synchronet þ Vertrauen þ Home of Synchronet þ
telnet://vert.synchro.net
þ wcQWK 7.0 ÷ ILink * Omicron Theta * Southaven MS * winserver.org
--- QScan/PCB v1.20a / 01-0462
* Origin: ILink: CFBBS | cfbbs.no-ip.com | 856-933-7096 (454:1/1)