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 Sun, 24 Oct 2010 11:20:14 GMT
On Sun, Oct 24, 2010 at 11:09, Alexander Farber
<alexander.farber@gmail.com> wrote:
> So for content handlers the convention is
> to use "SetHandler XXX" in httpd.conf and
> then at the runtime they check for that string with
>
> if (!r->handler || (strcmp(r->handler, "XXX") != 0)) {
>    return DECLINED;
> }
>
> But for protocol handlers there is no such convention.
> You have to introduce some keyword for httpd.conf
> and check for it. Or in my case you could just:
>
>        if (conn->base_server->port != 843)
>                return DECLINED;
>
> at the beginning? (seems to work)

Yes, that is correct. A config directive is the cleaner solution, though.

Mime
View raw message