httpd-modules-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ben Noordhuis <i...@bnoordhuis.nl>
Subject Re: How to access client socket from a protocol handler
Date Fri, 22 Oct 2010 22:52:10 GMT
On Sat, Oct 23, 2010 at 00:15, Alexander Farber
<alexander.farber@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 case (source code below)?

That's the reference to Apache itself, the core is a module too.
Elegant, isn't it?

> And why is direct socket I/O bad idea,
> isn't this how protocol handling modules (like mod_ftp, mod_smtp)
> are supposed to work?

There is no yes or no to this question, mostly it depends.

You should strive to use what is already in place, if only because it
will make your life easier down the road. Upsides to using the bucket
brigade and the filter chain:

* cross-platform
* published and supported APIs (will work with future releases of Apache)
* fairly straight-forward and transparent SSL/TLS integration

Downsides:

* overhead (slower)
* higher learning curve

So consider the pros and cons and pick the best solution. And don't
hesitate to ask questions if you have them. :)

Mime
View raw message