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 d280b6ecb3 http service break into outer loop states
Previously we sat and looped to dump a file over http protocol.

Actually that's a source of blocking to the other sockets being serviced.

This patch breaks up the file service into a roundtrip around the poll()
loop for each 512-byte packet.  It doesn't make much difference if the
server is idle, but if it's busy it makes sure everyone else is getting
service while the file is sent.

It doesn't try to optimize multiple users of the file or to keep the
descriptor open, the point of this patch is to establish the breaking up
of the file send action into the poll loop.

On the user side, there are two differences:

 - context is now needed in the first argument to libwebsockets_serve_http_file()
that's not too bad since we provide context in the callback.

 - file send is now asynchronous to the user code, you get a new callback coming
in protocol 0 when it's done, LWS_CALLBACK_HTTP_FILE_COMPLETION

libwebsockets-test-server is updated accordingly.

Signed-off-by: Andy Green <andy.green@linaro.org>
2013-01-15 16:00:36 +08:00
..
.gitignore Ignoring linux build files 2013-01-09 15:46:11 +08:00
base64-decode.c introduce logging api and convert all library output to use it 2013-01-10 22:16:37 +08:00
client-handshake.c deal with SSL_ERROR_WANT_ in client connect action 2013-01-15 15:43:31 +08:00
extension-deflate-frame.c logging ensure everyone has a newline 2013-01-15 15:41:15 +08:00
extension-deflate-frame.h Separate compression levels for server and client, 2013-01-10 12:45:54 +08:00
extension-deflate-stream.c introduce logging api and convert all library output to use it 2013-01-10 22:16:37 +08:00
extension-deflate-stream.h Fixed deflate-stream extension. 2013-01-09 18:17:42 +08:00
extension-x-google-mux.c audit and make all malloc check for OOM 2013-01-12 13:21:08 +08:00
extension-x-google-mux.h Use __inline for Win32 builds. 2013-01-10 10:07:16 +08:00
extension.c Added extension "deflate-frame". 2013-01-09 18:21:33 +08:00
getifaddrs.c introduce getifaddrs for toolchains without it 2013-01-12 20:39:47 +08:00
getifaddrs.h introduce getifaddrs for toolchains without it 2013-01-12 20:39:47 +08:00
handshake.c http service break into outer loop states 2013-01-15 16:00:36 +08:00
libwebsockets.c http service break into outer loop states 2013-01-15 16:00:36 +08:00
libwebsockets.h http service break into outer loop states 2013-01-15 16:00:36 +08:00
Makefile.am introduce getifaddrs for toolchains without it 2013-01-12 20:39:47 +08:00
md5.c introduce-private-md5-sha1.patch 2011-01-23 17:47:08 +00:00
parsers.c http service break into outer loop states 2013-01-15 16:00:36 +08:00
private-libwebsockets.h http service break into outer loop states 2013-01-15 16:00:36 +08:00
sha-1.c Static variable is now const. 2013-01-09 15:14:31 +08:00