The SHTTPD algorithm is as follows:
o every connection has associated descriptor, "struct conn", which holds
socket to client, opened local file descriptor, parsed headers, and other
info
o SHTTPD runs in an event loop. On every cycle, it collects all file
descriptors from all opened connections, and does select() on them.
o Once select() returns with indication of IO, an appropriate handler
functions are called. In case of embedded situation, that would be a user
callback function.
o If user callback fills the buffer, it will not be called. However, SHTTPD
in its event loop will try to send pending data to the client, and when it
frees up some space, it calls the user callback again, unless END_OF_OUTPUT
flag is set.
o END_OF_OUTPUT flag means that the callback must not be called anymore, and
when SHTTPD sends all pending data back to client, it closes the connection.
Hope that helps.
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
shttpd-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/shttpd-general