canonical libwebsockets.org websocket library
Find a file
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
lib http service break into outer loop states 2013-01-15 16:00:36 +08:00
scripts refactor-into-dirs.patch 2010-11-01 09:12:17 +00:00
test-server http service break into outer loop states 2013-01-15 16:00:36 +08:00
win32port zlib update 1.2.7 2013-01-10 10:03:42 +08:00
.gitignore Ignoring linux build files 2013-01-09 15:46:11 +08:00
autogen.sh use autogen.sh 2012-10-06 15:17:01 +08:00
configure.ac fix config enable name for getifaddrs 2013-01-12 23:31:39 +08:00
COPYING add-COPYING-lgpl-2.1.patch 2010-11-08 17:12:19 +00:00
INSTALL add-INSTALL.patch 2010-11-12 13:11:50 +00:00
libwebsockets-api-doc.html http service break into outer loop states 2013-01-15 16:00:36 +08:00
libwebsockets.pc.in add pkg-config file libwebsockets.pc 2012-10-19 18:26:22 +08:00
libwebsockets.spec uplevel-rpm-spec-to-include-new-extpoll-sample.patch 2011-02-13 09:08:11 +00:00
Makefile.am add pkg-config file libwebsockets.pc 2012-10-19 18:26:22 +08:00
README-test-server absorb README.rst into main README and code 2013-01-13 09:53:18 +08:00