1
0
Fork 0
mirror of https://github.com/warmcat/libwebsockets.git synced 2025-03-30 00:00:16 +01:00
libwebsockets/test-server
Andy Green fc7c5e4539 reflect send completeness in lws_write return
under load, writing packet sizes to the socket that are normally fine
can do partial writes, eg asking to write 4096 may only take 2800 of
it and return 2800 from the actual send.

Until now lws assumed that if it was safe to send, it could take any
size buffer, that's not the case under load.

This patch changes lws_write to return the amount actually taken...
that and the meaning of it becomes tricky when dealing with
compressed links, the amount taken and the amount sent differ.  Also
there is no way to recover at the moment from a protocol-encoded
frame only being partially accepted... however for http file send
content it can and does recover now.

Small frames don't have to take any care about it but large atomic
sends (> 2K) have been seen to fail under load.

Signed-off-by: Andy Green <andy.green@linaro.org>
2013-02-23 10:50:10 +08:00
..
.gitignore Ignoring linux build files 2013-01-09 15:46:11 +08:00
attack.sh introduce attack script 2013-02-12 14:16:09 +08:00
favicon.ico refactor-into-dirs.patch 2010-11-01 09:12:17 +00:00
leaf.jpg add by hand http send example 2013-02-14 23:24:07 +08:00
libwebsockets.org-logo.png add libwebsockets.org logo to share 2013-01-16 10:00:39 +08:00
Makefile.am add by hand http send example 2013-02-14 23:24:07 +08:00
test-client.c reflect send completeness in lws_write return 2013-02-23 10:50:10 +08:00
test-echo.c reflect send completeness in lws_write return 2013-02-23 10:50:10 +08:00
test-fraggle.c reflect send completeness in lws_write return 2013-02-23 10:50:10 +08:00
test-ping.c reflect send completeness in lws_write return 2013-02-23 10:50:10 +08:00
test-server.c reflect send completeness in lws_write return 2013-02-23 10:50:10 +08:00
test.html add by hand http send example 2013-02-14 23:24:07 +08:00