You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Atli Thorbjornsson <at...@gangverk.is> on 2003/05/30 10:38:05 UTC
FW: Apache socket question
Hello,
I use pre_connection to access the socket from Apache and, on certain
requests, hand it off to another process. Only problem is Apache seems to
call shutdown() on sockets once it is done with a request which ultimately
kills the socket. That makes perfect sense but is there anyway I could make
Apache not do it, ie just call close()? Reason being that I want to keep the
socket alive for further interaction with the client in my other process but
not have a whole Apache process hanging around in the meantime.
Atli Thorbjornsson,
Software Engineer,
Gangverk ehf.
Re: FW: Apache socket question
Posted by Jeff Trawick <tr...@attglobal.net>.
Ben Laurie wrote:
> Jeff Trawick wrote:
>
>
>>my suggestion on apache-modules was to set c->aborted in the
>>pre-connection hook, presumably after passing the descriptor
>>successfully to another process
>>
>>ap_lingering_close() doesn't perform the shutdown() if c->aborted
>
>
> Icky! Presumably the nice thing to do would be to invent a flag that
> inhibits the shutdown?
unclear to me whether or not skipping shutdown() is intrinsically linked
to c->aborted... I wouldn't be surprised if it is... some digging into
ancient 1.3 commit logs may offer some help on this issue
if it isn't intrinsically linked, allowing the module to tailor behavior
via a hook seems much better than adding flags for modules to tell us to
skip one sort of processing or another
btw, this module needs to doing something to set c->aborted anyway
Re: FW: Apache socket question
Posted by Ben Laurie <be...@algroup.co.uk>.
Jeff Trawick wrote:
>> While this is probably a bad idea, I bet that if you could trick
>> ap_lingering_close() not to close your socket when the connection is
>> closed, you might be able to get away with this.
>>
>> The relevent line in server/connection.c:214 is:
>>
>> apr_socket_t *csd = ap_get_module_config(c->conn_config, &core_module);
>>
>> So, something like:
>>
>> ap_set_module_config(c->conn_config, &core_module, NULL);
>>
>> in your module might do the trick. But, don't expect us to support
>> this. =) -- justin
>
>
> in fact, we might intentionally do something to make that blow up :)
>
> my suggestion on apache-modules was to set c->aborted in the
> pre-connection hook, presumably after passing the descriptor
> successfully to another process
>
> ap_lingering_close() doesn't perform the shutdown() if c->aborted
Icky! Presumably the nice thing to do would be to invent a flag that
inhibits the shutdown?
Cheers,
Ben.
--
http://www.apache-ssl.org/ben.html http://www.thebunker.net/
"There is no limit to what a man can do or how far he can go if he
doesn't mind who gets the credit." - Robert Woodruff
Re: FW: Apache socket question
Posted by Jeff Trawick <tr...@attglobal.net>.
> While this is probably a bad idea, I bet that if you could trick
> ap_lingering_close() not to close your socket when the connection is
> closed, you might be able to get away with this.
>
> The relevent line in server/connection.c:214 is:
>
> apr_socket_t *csd = ap_get_module_config(c->conn_config, &core_module);
>
> So, something like:
>
> ap_set_module_config(c->conn_config, &core_module, NULL);
>
> in your module might do the trick. But, don't expect us to support
> this. =) -- justin
in fact, we might intentionally do something to make that blow up :)
my suggestion on apache-modules was to set c->aborted in the
pre-connection hook, presumably after passing the descriptor
successfully to another process
ap_lingering_close() doesn't perform the shutdown() if c->aborted
Re: FW: Apache socket question
Posted by Justin Erenkrantz <ju...@erenkrantz.com>.
--On Friday, May 30, 2003 8:38 AM +0000 Atli Thorbjornsson <at...@gangverk.is>
wrote:
> I use pre_connection to access the socket from Apache and, on certain
> requests, hand it off to another process. Only problem is Apache seems to
> call shutdown() on sockets once it is done with a request which ultimately
> kills the socket. That makes perfect sense but is there anyway I could make
> Apache not do it, ie just call close()? Reason being that I want to keep the
> socket alive for further interaction with the client in my other process but
> not have a whole Apache process hanging around in the meantime.
While this is probably a bad idea, I bet that if you could trick
ap_lingering_close() not to close your socket when the connection is closed,
you might be able to get away with this.
The relevent line in server/connection.c:214 is:
apr_socket_t *csd = ap_get_module_config(c->conn_config, &core_module);
So, something like:
ap_set_module_config(c->conn_config, &core_module, NULL);
in your module might do the trick. But, don't expect us to support this. =)
-- justin