Share

axTLS Embedded SSL

Tracker: Bugs

5 shutdown() instead of SOCKET_CLOSE() - ID: 2878208
Last Update: Comment added ( brownesteemcom )

The function shutdown() should be used to close the cn->networkdesc instead
of SOCKET_CLOSE(). If the axhttpd launches a CGI app. and the CGI app.
forks a daemon, the cn->networkdesc is still not closed after the call to
SOCKET_CLOSE(). So, the browser never receives a FIN from the server and
the browser continues to look like it is waiting for more data. The
attached patch shows the simple one-line change.


Tom Brown ( brownesteemcom ) - 2009-10-13 20:13

5

Open

None

Nobody/Anonymous

None

None

Public


Comment ( 1 )




Date: 2009-10-14 15:17
Sender: brownesteemcom

The previous patch is incorrect. It calls shutdown() without the 'how'
parameter. My initial tests passed SHUT_RDWR as the 'how' parameter.
Further testing has shown that SHUT_WR works best. Additional research
revealed that a shutdown() should always be followed by a close(). So, the
new patch looks like this:

diff -Naur axTLS.orig/httpd/axhttpd.c axTLS/httpd/axhttpd.c
--- axTLS.orig/httpd/axhttpd.c 2009-03-13 05:56:24.000000000 -0700
+++ axTLS/httpd/axhttpd.c 2009-10-14 08:08:49.000000000 -0700
@@ -570,6 +570,7 @@
cn->ssl = NULL;
}

+ shutdown(cn->networkdesc, SHUT_WR);
SOCKET_CLOSE(cn->networkdesc);
}



Log in to comment.

Attached File ( 1 )

Filename Description Download
axTLS_shutdown.patch shutdown patch Download

Change ( 1 )

Field Old Value Date By
File Added 346494: axTLS_shutdown.patch 2009-10-13 20:13 brownesteemcom