[tbnl-devel] Odd behavior (socket leak)

Edi Weitz edi at agharta.de
Sat Jul 17 10:48:18 UTC 2004


[Looks like it didn't work the first time with common-lisp.net - maybe due
to my misconfiguration of SquirrelMail. I'll try it again. Note that Peter
has already pointed out my mistaken assumption.]

I'm sitting in a train and trying to send this via my cell
phone. Let's see if it works... :)

I've looked at the source code of mod_lisp.c (version 2.33) and Apache
(1.3.29) and I'm beginning to ask myself whether the "Keep-Socket" option
makes any sense at all. What I see with my limited knowledge of Apache is
the following:

1. The actual content handler in mod_lisp.c which is called each time
   a new request comes in (from the client) is the function
   lisp_handler.

2. To get a socket, lisp-handler calls OpenLispSocket.

3. OpenLispSocket uses ap_psocket (using the global variable
   SocketPool) to get a socket from Apache.

4. ap_psocket is defined in Apache's src/main/alloc.c and basically
   just calls ap_psocket_ex.

5. ap_socket_ex always unconditionally acquires a new socket via
   socket(7). The pool which is its first argument (and which is
   SocketPool from above) is only used for cleanup purposes.

So, as a consequence, I cannot understand if and how the socket used by
lisp_handler is ever going to be re-used.

I'm sending a copy of this email to mod-lisp-devel because Marc is the
authoritative source for this kind of questions... :)

Cheers,
Edi.







More information about the Tbnl-devel mailing list