libwebsockets/lib
Andy Green 2c218e705f ah owns rxbuf
This is intended to solve a longstanding problem with the
relationship between http/1.1 keep-alive and the service
loop.

Ah now contain an rx buffer which is used during header
processing, and the ah may not be detached from the wsi
until the rx buffer is exhausted.

Having the rx buffer in the ah means we can delay using the
rx until a later service loop.

Ah which have pending rx force POLLIN service on the wsi
they are attached to automatically, so we can interleave
general service / connections with draining each ah rx
buffer.

The possible http/1.1 situations and their dispositions are:

 1) exactly one set of http headers come.  After processing,
    the ah is detached since no pending rx left.  If more
    headers come later, a fresh ah is aqcuired when available
    and the rx flow control blocks the read until then.

 2) more that one whole set of headers come and we remain in
    http mode (no upgrade).  The ah is left attached and
    returns to the service loop after the first set of headers.
    We will get forced service due to the ah having pending
    content (respecting flowcontrol) and process the pending
    rx in the ah.  If we use it all up, we will detach the
    ah.

 3) one set of http headers come with ws traffic appended.
    We service the headers, do the upgrade, and keep the ah
    until the remaining ws content is used.  When we
    exhausted the ws traffix in the ah rx buffer, we
    detach the ah.

Since there can be any amount of http/1.1 pipelining on a
connection, and each may be expensive to service, it's now
enforced there is a return to the service loop after each
header set is serviced on a connection.

When I added the forced service for ah with pending buffering,
I added support for it to the windows plat code.  However this
is untested.

Signed-off-by: Andy Green <andy.green@linaro.org>
2016-02-15 14:57:55 +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 license clarification and test apps CC zero 2016-02-08 08:44:21 +08:00
client-handshake.c ah owns rxbuf 2016-02-15 14:57:55 +08:00
client-parser.c clean pre 1.7 2016-01-29 23:17:43 +08:00
client.c ah owns rxbuf 2016-02-15 14:57:55 +08:00
context.c libuv integration 2016-02-14 09:31:13 +08:00
daemonize.c license clarification and test apps CC zero 2016-02-08 08:44:21 +08:00
extension-permessage-deflate.c clean pre 1.7 2016-01-29 23:17:43 +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 ah owns rxbuf 2016-02-15 14:57:55 +08:00
header.c multithreaded service 2016-01-19 20:02:36 +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 libuv integration 2016-02-14 09:31:13 +08:00
libuv.c libuv integration 2016-02-14 09:31:13 +08:00
libwebsockets.c ah owns rxbuf 2016-02-15 14:57:55 +08:00
libwebsockets.h libuv integration 2016-02-14 09:31:13 +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 ah owns rxbuf 2016-02-15 14:57:55 +08:00
lws-plat-win.c ah owns rxbuf 2016-02-15 14:57:55 +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 clean pre 1.7 2016-01-29 23:17:43 +08:00
parsers.c ah owns rxbuf 2016-02-15 14:57:55 +08:00
pollfd.c libuv integration 2016-02-14 09:31:13 +08:00
private-libwebsockets.h ah owns rxbuf 2016-02-15 14:57:55 +08:00
server-handshake.c clean pre 1.7 2016-01-29 23:17:43 +08:00
server.c ah owns rxbuf 2016-02-15 14:57:55 +08:00
service.c ah owns rxbuf 2016-02-15 14:57:55 +08:00
sha-1.c clean reduce windows build warnings 2015-12-06 08:00:03 +08:00
ssl-http2.c clean internal refactor 2015-12-17 17:03:59 +08:00
ssl.c libuv integration 2016-02-14 09:31:13 +08:00