On 11/3/07, Sergey Lyubka <[EMAIL PROTECTED]> wrote: > I presume, this is what happens: > > At first request, SHTTPD does usual things and > your callback gets the HTTP data, as normal. > > Then, when you hit refresh, firefox uses the same connection > to send next request, i.e. keep-alive. > > Your callback is called second time for the same connection. > Although it is a new request, SHTTPD does not know that, > thinks this is HTTP data. That's why you see full request. > > Is that true that firefox does not close the connection > even though you sent "Connection: close" header ? > > sergey > I replace the DBG macro with a more verbose one, and I think shttpd is the one not closing the sockets, on exit, since I don't see any "Disconnecting 9" mesage. I figure that since the socket is not closed, Firefox will not know that the server was shut down.
Sun Nov 4 01:56:26 20 5825 shttpd.c 1053 : [ shttpd_poll] : rem: 0 [] Sun Nov 4 01:56:26 20 5825 shttpd.c 821 : [ read_stream] : read_stream (9 file): read 2550/2550/2550 bytes (errno 2) Sun Nov 4 01:56:26 20 5825 shttpd.c 149 : [ stop_stream] : 9 (null) stopped. 2550 of content data, 2743 now in a buffer Sun Nov 4 01:56:26 20 5825 shttpd.c 851 : [ write_stream] : write_stream (9 socket): written 2743/2743 bytes (errno 2) Sun Nov 4 01:56:26 20 5825 shttpd.c 869 : [ disconnect] : Disconnecting 9 (keep-alive Sun Nov 4 01:56:26 20 5825 shttpd.c 952 : [ shttpd_poll] : FD_SET(6) (listening) Sun Nov 4 01:56:26 20 5825 shttpd.c 952 : [ shttpd_poll] : FD_SET(8) (listening) Sun Nov 4 01:56:27 20 5825 shttpd.c 952 : [ shttpd_poll] : FD_SET(6) (listening) Sun Nov 4 01:56:27 20 5825 shttpd.c 952 : [ shttpd_poll] : FD_SET(8) (listening) Sun Nov 4 01:56:28 20 5825 shttpd.c 952 : [ shttpd_poll] : FD_SET(6) (listening) Sun Nov 4 01:56:28 20 5825 shttpd.c 952 : [ shttpd_poll] : FD_SET(8) (listening) Sun Nov 4 01:56:29 20 5825 shttpd.c 952 : [ shttpd_poll] : FD_SET(6) (listening) Sun Nov 4 01:56:29 20 5825 shttpd.c 952 : [ shttpd_poll] : FD_SET(8) (listening) Sun Nov 4 01:56:30 20 5825 shttpd.c 952 : [ shttpd_poll] : FD_SET(6) (listening) Sun Nov 4 01:56:30 20 5825 shttpd.c 952 : [ shttpd_poll] : FD_SET(8) (listening) Sun Nov 4 01:56:31 20 5825 shttpd.c 952 : [ shttpd_poll] : FD_SET(6) (listening) Sun Nov 4 01:56:31 20 5825 shttpd.c 952 : [ shttpd_poll] : FD_SET(8) (listening) Sun Nov 4 01:56:32 20 5825 shttpd.c 952 : [ shttpd_poll] : FD_SET(6) (listening) Sun Nov 4 01:56:32 20 5825 shttpd.c 952 : [ shttpd_poll] : FD_SET(8) (listening) Sun Nov 4 01:56:33 20 5825 signal_handlers.c 86 : [ onSigTerm] : SIGTERM Sun Nov 4 01:56:33 20 5825 shttpd.c 1011 : [ shttpd_poll] : select: 4 Sun Nov 4 01:56:33 20 5825 xmlrpc_svc.c 73 : [ start_XmlRPC] : Service exiting Sun Nov 4 01:56:37 20 5826 config.c 258 : [ initialize_context] : init_ctx: initialized context 0x80832b8 Sun Nov 4 01:56:37 20 5826 shttpd.c 768 : [ shttpd_listen] : shttpd_listen: added socket 6 Sun Nov 4 01:56:37 20 5826 shttpd.c 768 : [ shttpd_listen] : shttpd_listen: added socket 8 Sun Nov 4 01:56:37 20 5826 shttpd.c 952 : [ shttpd_poll] : FD_SET(6) (listening) Sun Nov 4 01:56:37 20 5826 shttpd.c 952 : [ shttpd_poll] : FD_SET(8) (listening) Sun Nov 4 01:56:38 20 5826 shttpd.c 952 : [ shttpd_poll] : FD_SET(6) (listening) Sun Nov 4 01:56:38 20 5826 shttpd.c 952 : [ shttpd_poll] : FD_SET(8) (listening) Sun Nov 4 01:56:39 20 5826 shttpd.c 735 : [ shttpd_add_socket] : 127.0.0.1:8000 connected (socket 9 Sun Nov 4 01:56:39 20 5826 shttpd.c 1052 : [ shttpd_poll] : loc: 0 [] -- Regards, Groleo! ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ _______________________________________________ shttpd-general mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/shttpd-general
