From edi at agharta.de Mon Aug 2 09:05:23 2004 From: edi at agharta.de (Edi Weitz) Date: Mon, 02 Aug 2004 11:05:23 +0200 Subject: [mod-lisp-devel] Multiple mod_lisps (Was: Socket leaks, again) In-Reply-To: <87d62tp3ru.fsf@bird.agharta.de> (Edi Weitz's message of "Sun, 18 Jul 2004 20:29:57 +0200") References: <87d62tp3ru.fsf@bird.agharta.de> Message-ID: <87acxd29m4.fsf@bird.agharta.de> Hi! The recent 2.35 patch unfortunately introduces the possibility for another bug: If you've configured multiple mod_lisp instances in one Apache then a socket which has served one Lisp image may be re-used for a different Lisp image. This shouldn't happen, of course. The attached patch tries to fix that. It stores the server ip address and port together with the socket and only re-uses the socket if the former values haven't changed. Cheers, Edi. -------------- next part -------------- A non-text attachment was scrubbed... Name: mod_lisp_2_37.patch Type: text/x-patch Size: 2942 bytes Desc: not available URL: From edi at agharta.de Mon Aug 2 09:12:35 2004 From: edi at agharta.de (Edi Weitz) Date: Mon, 02 Aug 2004 11:12:35 +0200 Subject: [mod-lisp-devel] One more... :) Message-ID: <87658129a4.fsf@bird.agharta.de> Attached is another little patch. I made this a different patch from the previous one (2.37) because it might be a bit controversial. I've added two new headers - "apache-baseversion" which corresponds to the APACHE_BASEVERSION constant (something like "Apache/1.3.29") and "modlisp-version" which corresponds to the mod_lisp version string in mod_lisp.c. I think it'd be nice to have these so the Lisp side can prepare better diagnostic messages. One might argue that it's overhead to send these headers with every request. I personally think that this is not an issue because mod_lisp is already extremely fast and it doesn't really matter whether you send another 20 or 30 bytes through the socket or not. One might also argue that this is static information which should only be sent once. I'd disagree because - as we all know - you can update your Apache while your Lisp image keeps running. You can also update mod_lisp while your Lisp image keeps running. In both cases your Lisp application will have the new versions available immediately. Cheers, Edi. -------------- next part -------------- A non-text attachment was scrubbed... Name: mod_lisp_2_38.patch Type: text/x-patch Size: 846 bytes Desc: not available URL: From edi at agharta.de Tue Aug 3 05:41:53 2004 From: edi at agharta.de (Edi Weitz) Date: Tue, 03 Aug 2004 07:41:53 +0200 Subject: [mod-lisp-devel] Multiple mod_lisps In-Reply-To: <87acxd29m4.fsf@bird.agharta.de> (Edi Weitz's message of "Mon, 02 Aug 2004 11:05:23 +0200") References: <87d62tp3ru.fsf@bird.agharta.de> <87acxd29m4.fsf@bird.agharta.de> Message-ID: <876580lqvy.fsf@bird.agharta.de> On Mon, 02 Aug 2004 11:05:23 +0200, Edi Weitz wrote: > @@ -431,11 +442,13 @@ > #ifndef WIN32 > if (LispSocket) > { > - if (UnsafeLispSocket) > + if (UnsafeLispSocket || strcmp(cfg->LispServerIP, LispServerIP) || cfg->LispServerPort != LispServerPort) > { > ap_pclosesocket(SocketPool, LispSocket); > LispSocket = 0; > UnsafeLispSocket = 0; > + LispServerIP[0] = 0; > + LispServerPort = 0; > } > else > return LispSocket; As a micro-optimization one might want to replace the line above with + if (UnsafeLispSocket || cfg->LispServerPort != LispServerPort || strcmp(cfg->LispServerIP, LispServerIP)) Comparing two longs should generally be faster than calling strcmp and it's not unlikely that that the different Lisp images will be on the same machine but use different ports. Cheers, Edi. From marc.battyani at fractalconcept.com Mon Aug 16 20:49:25 2004 From: marc.battyani at fractalconcept.com (Marc Battyani) Date: Mon, 16 Aug 2004 22:49:25 +0200 Subject: [mod-lisp-devel] mod_lisp 2.38 References: <87d62tp3ru.fsf@bird.agharta.de> <87acxd29m4.fsf@bird.agharta.de> <876580lqvy.fsf@bird.agharta.de> Message-ID: <003301c483d2$855c0e30$0a02a8c0@marcxp> mod_lisp version 2.38 is on the mod_lisp repository: http://www.fractalconcept.com:8000/public/open-source/ Version 2.38 New "server-baseversion" and "modlisp-version" headers (Edi Weitz) Version 2.37 Create new socket (instead of reusing) if IP/port combo has changed (Edi Weitz) Thanks again to Edi :) Marc