1
0
Fork 0
mirror of https://github.com/warmcat/libwebsockets.git synced 2025-03-16 00:00:07 +01:00
libwebsockets/lib
Andy Green ad40037c80 recv revert treating zero as hangup
While checking with ab, I found
commit 30cdb3ac8f
Author: Justin Chen <justinchen00@github.invalid.com>
Date:   Thu Apr 14 21:40:53 2016 +0800

    recv treat zero return as error

    https://github.com/warmcat/libwebsockets/issues/475

turned ab performance to crap, reverting it made everything fast again.

recv manpage says there is three ways to get zero returned

1)       When a stream socket peer has performed an orderly shutdown, the return value will be 0  (the  traditional  "end-of-file"
       return).

2)       Datagram  sockets  in  various  domains  (e.g., the UNIX and Internet domains) permit zero-length datagrams.  When such a
       datagram is received, the return value is 0.

3)       The value 0 may also be returned if the requested number of bytes to receive from a stream socket was 0.

we can't just assume it means the peer shut down.

If the peer shut down, then the event loop should get an event on the socket like POLLHUP and deal with it that way.

So the patch mentioned above is simply reverted here.

Signed-off-by: Andy Green <andy@warmcat.com>
2016-05-05 09:06:09 +08:00
..
.gitignore Ignoring linux build files 2013-01-09 15:46:11 +08:00
alloc.c Subject: [PATCH] Add custom allocator support using the realloc() interface 2014-12-05 07:25:24 +08:00
base64-decode.c b64decode correct decode of some strings 2016-03-19 07:43:22 +08:00
client-handshake.c client fix reaction to tls failure 2016-05-03 07:26:10 +08:00
client-parser.c LWS_SERVER_OPTION_DO_SSL_GLOBAL_INIT to default to runtime ssl disable 2016-03-23 09:22:11 +08:00
client.c client provide user_space on LWS_CALLBACK_CLIENT_APPEND_HANDSHAKE_HEADER 2016-05-03 21:39:16 +08:00
context.c clean build warning on windows 2016-05-04 11:11:15 +08:00
daemonize.c cgi post 2016-04-13 11:53:40 +08:00
extension-permessage-deflate.c extensions add api for user code option manipulation 2016-04-08 09:45:49 +08:00
extension-permessage-deflate.h extension permessage deflate 2016-01-11 11:34:01 +08:00
extension.c extensions add api for user code option manipulation 2016-04-08 09:45:49 +08:00
getifaddrs.c whitespace trailing mass cleanout 2015-12-14 08:52:03 +08:00
getifaddrs.h Use LWS_HAVE_ instead of just HAVE_ 2015-10-12 09:53:17 +08:00
handshake.c client http 2016-04-18 20:05:43 +08:00
header.c post example in test server 2016-04-25 10:04:49 +08:00
hpack.c http2 update integration 2016-04-13 11:53:40 +08:00
http2.c http2 handle error path on ensure_user_space 2016-04-23 09:36:18 +08:00
huftable.h http2 hpack basic decode ok including huff 2014-10-12 08:38:16 +08:00
lextable-strings.h http2 update integration 2016-04-13 11:53:40 +08:00
lextable.h http2 update integration 2016-04-13 11:53:40 +08:00
libev.c plugins 2016-04-07 09:38:08 +08:00
libuv.c libuv fixes for foreign loop test 2016-05-04 08:40:46 +08:00
libwebsockets.c stats upgrade rx tx to long long 2016-05-04 15:59:55 +08:00
libwebsockets.h plugins_dir convert to array 2016-05-02 10:03:25 +08:00
lws-plat-mbed3.c mbed align with pt changes 2016-01-20 17:35:18 +08:00
lws-plat-mbed3.cpp mbed align with pt changes 2016-01-20 17:35:18 +08:00
lws-plat-unix.c libuv fixes for foreign loop test 2016-05-04 08:40:46 +08:00
lws-plat-win.c Fixes for building with MinGW 2016-04-27 07:31:22 +08:00
minihuf.c whitespace trailing mass cleanout 2015-12-14 08:52:03 +08:00
minilex.c whitespace trailing mass cleanout 2015-12-14 08:52:03 +08:00
output.c recv revert treating zero as hangup 2016-05-05 09:06:09 +08:00
parsers.c urldecode forbid malformed 2016-04-07 10:08:35 +08:00
pollfd.c vh doubly linked list for wsi on same protocol 2016-04-16 08:40:35 +08:00
private-libwebsockets.h stats upgrade rx tx to long long 2016-05-04 15:59:55 +08:00
rewrite.c proxy rewrite 2016-03-20 11:59:53 +08:00
server-handshake.c test server align rxbuf with permessage deflate rx buf size 2016-04-01 08:47:05 +08:00
server.c create_vhost move mounts list to info 2016-05-02 04:59:54 +08:00
service.c client fix reaction to tls failure 2016-05-03 07:26:10 +08:00
sha-1.c polarssl implementation 2016-04-18 20:05:43 +08:00
ssl-client.c client fix reaction to tls failure 2016-05-03 07:26:10 +08:00
ssl-http2.c http2 update integration 2016-04-13 11:53:40 +08:00
ssl-server.c polarssl implementation 2016-04-18 20:05:43 +08:00
ssl.c client fix reaction to tls failure 2016-05-03 07:26:10 +08:00