libwebsockets/lib
Andy Green d2feeee1d6 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:23:05 +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:48:24 +08:00
client-handshake.c client fix reaction to tls failure 2016-05-03 08:08:32 +08:00
client-parser.c clean pre 1.7 2016-01-29 23:17:43 +08:00
client.c client provide user_space on LWS_CALLBACK_CLIENT_APPEND_HANDSHAKE_HEADER 2016-05-03 21:41:24 +08:00
context.c android fix rlimit 2016-04-08 16:04:58 +08:00
daemonize.c daemonize work under systemd 2016-02-20 08:04:32 +08:00
extension-permessage-deflate.c test server align rxbuf with permessage deflate rx buf size 2016-04-01 09:30:09 +08:00
extension-permessage-deflate.h extension permessage deflate 2016-01-11 11:34:01 +08:00
extension.c libuv integration 2016-02-14 09:31:13 +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 timeout settable from info 2016-02-15 20:39:07 +08:00
header.c lws_return_http_status send content length 2016-02-20 08:04:56 +08:00
hpack.c http header malloc pool implement pool 2015-12-25 14:34:20 +08:00
http2.c extension permessage deflate 2016-01-11 11:34:01 +08:00
huftable.h http2 hpack basic decode ok including huff 2014-10-12 08:38:16 +08:00
lextable-strings.h lextable add x-real-ip 2016-01-28 09:40:53 +08:00
lextable.h lextable add x-real-ip 2016-01-28 09:40:53 +08:00
libev.c libev set foreign loop properly 2016-03-09 07:47:34 +08:00
libuv.c libuv add idle processing to force service where needed 2016-04-07 18:56:40 +08:00
libwebsockets.c wince minor adaptations 2016-03-01 07:33:56 +08:00
libwebsockets.h Add warn_unused_result check, attribute only supported by GCC 3.4 or later 2016-04-30 02:08:11 +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 cruft remove sigusr2 handling 2016-04-22 21:58:38 +08:00
lws-plat-win.c libuv add idle processing to force service where needed 2016-04-07 18:56:40 +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:23:05 +08:00
parsers.c urldecode forbid malformed 2016-04-07 18:57:28 +08:00
pollfd.c defeat POLLOUT if socket in shutdown wait 2016-02-24 21:32:31 +08:00
private-libwebsockets.h Android needs sys/resource.h 2016-04-23 17:19:07 +08:00
server-handshake.c test server align rxbuf with permessage deflate rx buf size 2016-04-01 09:30:09 +08:00
server.c uri processing reject paths not starting with slash 2016-04-02 08:03:48 +08:00
service.c client fix reaction to tls failure 2016-05-03 08:08:32 +08:00
sha-1.c Fix build with musl libc 2016-03-30 06:24:24 +08:00
ssl-http2.c http2 build with alpn capable ssl no debug 2016-03-25 21:03:01 +08:00
ssl.c ssl ecdh adapt if missing ecdh.h include 2016-03-12 08:49:09 +08:00