How to access client socket from a protocol handler

2010-10-22 Thread Alexander Farber
Hello, I have a simple Perl module (source code at the bottom), which sends a string to clients connecting to port 843. It works ok, but I'd like to rewrite it in C because it seems to use 20m for this simple task at my CentOS 5.5/64 Linux with httpd-2.2.3-43 and mod_perl-2.0.4: PID USER

Re: How to access client socket from a protocol handler

2010-10-22 Thread Alexander Farber
Hi Ben, On Fri, Oct 22, 2010 at 11:54 PM, Ben Noordhuis i...@bnoordhuis.nl wrote: On Fri, Oct 22, 2010 at 23:08, Alexander Farber alexander.far...@gmail.com wrote: but don't know how to get the client socket via conn_rec? apr_socket_t *client  = ap_get_module_config(conn-conn_config,

Re: How to access client socket from a protocol handler

2010-10-22 Thread Ben Noordhuis
On Sat, Oct 23, 2010 at 00:01, Mike Meyer mwm-keyword-apache.b9a...@mired.org wrote: I use that to get the socket so I can poll for it to have data in it, and do other things while I'm waiting. Is there a better alternative for that, or is this an exception? You could do it through

Re: How to access client socket from a protocol handler

2010-10-22 Thread Ben Noordhuis
On Sat, Oct 23, 2010 at 00:15, Alexander Farber alexander.far...@gmail.com wrote: Should I maybe try apr_socket_t *socket = conn-cs-desc-s or something similar instead? Probably not, the conn_config solution is most portable across Apache versions. And what do you mean by core_module in my