You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Rolf Banting <ro...@gmail.com> on 2007/11/01 13:52:52 UTC

UDP support in mod_perl2/apache

Hi,

I'd like to able to transplant a kind of gateway app I have written
from a POE to mod_perl2. Why? Well mainly so I have an excuse to get
into mod_perl2 & apache.

What the app does is accept client requests in a proprietrary protocol
carried over UDP and translate them either into synchronous CORBA
calls or asynchronous requests over the proprietrary protocol to an
external server. In turn server repsonses are then translated and sent
back to the original client.

I have scanned the mail archives and found references to some UDP
based work that different people were doing but I can't see if
anything got released.

Did the mod_udp development get into release mode or are there other
ways to get mod_perl to listen to UDP ?

Thanks in advance,

Rolf

Re: UDP support in mod_perl2/apache

Posted by Issac Goldstand <ma...@beamartyr.net>.
With the existing patchset, UDP will just work like TCP - just add
ListenUDP directives wherever you want to a UDP port.  Future versions
of Apache httpd (once UDP is bundled as a part of the official release,
which is in the works) might need additional configuration directives to
work, but that's still a while off.

  Issac

Rolf Banting wrote:
> On 11/14/07, Issac Goldstand <ma...@beamartyr.net> wrote:
>> I just realized that there was a typo in the patchset - it applies
>> cleanly against httpd-2.2.6, but there's a line that shouldn't be there:
>>
>> srclib/apr/network_io/unix/sendrecv.c line 118:
>>     from->salen = sizeof(from->sa);
>>
>> Remove this and it should build cleanly.
>>
>>   Issac
>>
> 
> I've now managed to get 2.2.6 patched. I had to tweak a couple of the
> patches manually. I'll put together a patchfile shortly. Best of all
> mod_perl2 builds and tests OK - 4 failures in subprocess & 1 in
> server_constant.
> 
> This all but removes Issac's UDP patch as a suspect in the case of the
> mp2- tests-fail -against-httpd-trunk.
> 
> So now then - how do I set up a UDP service? Is there any special configuration?
> 
> Rolf

Re: UDP support in mod_perl2/apache

Posted by Rolf Banting <ro...@gmail.com>.
On 11/14/07, Issac Goldstand <ma...@beamartyr.net> wrote:
> I just realized that there was a typo in the patchset - it applies
> cleanly against httpd-2.2.6, but there's a line that shouldn't be there:
>
> srclib/apr/network_io/unix/sendrecv.c line 118:
>     from->salen = sizeof(from->sa);
>
> Remove this and it should build cleanly.
>
>   Issac
>

I've now managed to get 2.2.6 patched. I had to tweak a couple of the
patches manually. I'll put together a patchfile shortly. Best of all
mod_perl2 builds and tests OK - 4 failures in subprocess & 1 in
server_constant.

This all but removes Issac's UDP patch as a suspect in the case of the
mp2- tests-fail -against-httpd-trunk.

So now then - how do I set up a UDP service? Is there any special configuration?

Rolf

Re: UDP support in mod_perl2/apache

Posted by Issac Goldstand <ma...@beamartyr.net>.
I just realized that there was a typo in the patchset - it applies
cleanly against httpd-2.2.6, but there's a line that shouldn't be there:

srclib/apr/network_io/unix/sendrecv.c line 118:
    from->salen = sizeof(from->sa);

Remove this and it should build cleanly.

  Issac

Rolf Banting wrote:
> OK - well I didn't have any luck with the 2.26 patch so I got hold of
> the trunk and applied Issac's original patchset. One of the
> core_filters.c hunks failed, otherwise the patch went through. I
> manually tweaked core_filters & now everything builds.
>
> Sometime over the weekend I'll have a go with mod_perl.
>
> Rolf
>   



Re: UDP support in mod_perl2/apache

Posted by Issac Goldstand <ma...@beamartyr.net>.
[removed modperl cc]

+1  That's why the original patchset was prepared against trunk.  The
backport in my previous mail is more for getting feedback from
early-adopters...

 Issac

William A. Rowe, Jr. wrote:
> Issac Goldstand wrote:
>> Nice.  A cursory look appears to match what I have.
>>
>> I also dug up another nugget - a complete patch against httpd-2.2.6 for
>> the UDP support (excluding only the APR recvfrom issue) - I thought I
>> had it lying around somewhere.  I included two; one with and one without
>> the APR backport.  Rolf, try to use this (use the one with the
>> apr-backport) instead of downloading and patching trunk.
> 
> Rather than busting on 2.2.{stale} I'd much rather focus on getting your
> proposed enhancements into trunk, and plow forward to ship 2.4 httpd for
> udp support.  My 2c US (small and shrinking)
> 
> Bill

Re: UDP support in mod_perl2/apache

Posted by "William A. Rowe, Jr." <wr...@rowe-clan.net>.
Issac Goldstand wrote:
> Nice.  A cursory look appears to match what I have.
> 
> I also dug up another nugget - a complete patch against httpd-2.2.6 for
> the UDP support (excluding only the APR recvfrom issue) - I thought I
> had it lying around somewhere.  I included two; one with and one without
> the APR backport.  Rolf, try to use this (use the one with the
> apr-backport) instead of downloading and patching trunk.

Rather than busting on 2.2.{stale} I'd much rather focus on getting your
proposed enhancements into trunk, and plow forward to ship 2.4 httpd for
udp support.  My 2c US (small and shrinking)

Bill

Re: UDP support in mod_perl2/apache

Posted by "William A. Rowe, Jr." <wr...@rowe-clan.net>.
Issac Goldstand wrote:
> Nice.  A cursory look appears to match what I have.
> 
> I also dug up another nugget - a complete patch against httpd-2.2.6 for
> the UDP support (excluding only the APR recvfrom issue) - I thought I
> had it lying around somewhere.  I included two; one with and one without
> the APR backport.  Rolf, try to use this (use the one with the
> apr-backport) instead of downloading and patching trunk.

Rather than busting on 2.2.{stale} I'd much rather focus on getting your
proposed enhancements into trunk, and plow forward to ship 2.4 httpd for
udp support.  My 2c US (small and shrinking)

Bill

Re: UDP support in mod_perl2/apache

Posted by Issac Goldstand <ma...@beamartyr.net>.
Nice.  A cursory look appears to match what I have.

I also dug up another nugget - a complete patch against httpd-2.2.6 for
the UDP support (excluding only the APR recvfrom issue) - I thought I
had it lying around somewhere.  I included two; one with and one without
the APR backport.  Rolf, try to use this (use the one with the
apr-backport) instead of downloading and patching trunk.

  Issac

William A. Rowe, Jr. wrote:
> Issac Goldstand wrote:
>>
>> The same patchset can be used for 2.2.x branch pretty much as is with
>> the single addition of backporting the apr_socket_sendto function from
>> trunk (it's broken in the APR that ships with 2.2.x)
> 
> We agree that's true - have you looked at apr 1.2.x branch lately?  A week
> or so ago I backported the fixes to properly fix up apr_socket_recvfrom,
> and am wondering if there are additional bug fixes required to this code?
> Or is this the addition of a feature (which 1.2.x will not offer)?
> 
> Bill

Re: UDP support in mod_perl2/apache

Posted by Issac Goldstand <ma...@beamartyr.net>.
Nice.  A cursory look appears to match what I have.

I also dug up another nugget - a complete patch against httpd-2.2.6 for
the UDP support (excluding only the APR recvfrom issue) - I thought I
had it lying around somewhere.  I included two; one with and one without
the APR backport.  Rolf, try to use this (use the one with the
apr-backport) instead of downloading and patching trunk.

  Issac

William A. Rowe, Jr. wrote:
> Issac Goldstand wrote:
>>
>> The same patchset can be used for 2.2.x branch pretty much as is with
>> the single addition of backporting the apr_socket_sendto function from
>> trunk (it's broken in the APR that ships with 2.2.x)
> 
> We agree that's true - have you looked at apr 1.2.x branch lately?  A week
> or so ago I backported the fixes to properly fix up apr_socket_recvfrom,
> and am wondering if there are additional bug fixes required to this code?
> Or is this the addition of a feature (which 1.2.x will not offer)?
> 
> Bill

Re: UDP support in mod_perl2/apache

Posted by "William A. Rowe, Jr." <wr...@rowe-clan.net>.
Issac Goldstand wrote:
> 
> The same patchset can be used for 2.2.x branch pretty much as is with
> the single addition of backporting the apr_socket_sendto function from
> trunk (it's broken in the APR that ships with 2.2.x)

We agree that's true - have you looked at apr 1.2.x branch lately?  A week
or so ago I backported the fixes to properly fix up apr_socket_recvfrom,
and am wondering if there are additional bug fixes required to this code?
Or is this the addition of a feature (which 1.2.x will not offer)?

Bill

Re: UDP support in mod_perl2/apache

Posted by "William A. Rowe, Jr." <wr...@rowe-clan.net>.
Issac Goldstand wrote:
> 
> The same patchset can be used for 2.2.x branch pretty much as is with
> the single addition of backporting the apr_socket_sendto function from
> trunk (it's broken in the APR that ships with 2.2.x)

We agree that's true - have you looked at apr 1.2.x branch lately?  A week
or so ago I backported the fixes to properly fix up apr_socket_recvfrom,
and am wondering if there are additional bug fixes required to this code?
Or is this the addition of a feature (which 1.2.x will not offer)?

Bill

Re: UDP support in mod_perl2/apache

Posted by Issac Goldstand <ma...@beamartyr.net>.
I put out a patchset a few months ago to support UDP in trunk and 2.2.x
branches of httpd (for a mod_dns protocol module that we're  currently
in the process of releasing to the public).  The patchset only works for
the unix flavor of APR and the prefork MPM at the moment (I'm sure if it
gets adopted we can work out the other MPMs and APR flavors)

You can grab the patchset for trunk at
http://www.mail-archive.com/dev@httpd.apache.org/msg37727.html

The same patchset can be used for 2.2.x branch pretty much as is with
the single addition of backporting the apr_socket_sendto function from
trunk (it's broken in the APR that ships with 2.2.x)

If you have any issues applying it/using it/integrating with mod_per
(though I don't think the mod_perl API should need any tweaking to
utilize this), I'd be happy to work with you (or whomever else).

With ApacheCon & the hackathon coming up soon, this would be a great
time to ping dev@httpd for possible inclusion in trunk...

  Issac

Rolf Banting wrote:
> Hi,
> 
> I'd like to able to transplant a kind of gateway app I have written
> from a POE to mod_perl2. Why? Well mainly so I have an excuse to get
> into mod_perl2 & apache.
> 
> What the app does is accept client requests in a proprietrary protocol
> carried over UDP and translate them either into synchronous CORBA
> calls or asynchronous requests over the proprietrary protocol to an
> external server. In turn server repsonses are then translated and sent
> back to the original client.
> 
> I have scanned the mail archives and found references to some UDP
> based work that different people were doing but I can't see if
> anything got released.
> 
> Did the mod_udp development get into release mode or are there other
> ways to get mod_perl to listen to UDP ?
> 
> Thanks in advance,
> 
> Rolf


Re: UDP support in mod_perl2/apache

Posted by Issac Goldstand <ma...@beamartyr.net>.
I put out a patchset a few months ago to support UDP in trunk and 2.2.x
branches of httpd (for a mod_dns protocol module that we're  currently
in the process of releasing to the public).  The patchset only works for
the unix flavor of APR and the prefork MPM at the moment (I'm sure if it
gets adopted we can work out the other MPMs and APR flavors)

You can grab the patchset for trunk at
http://www.mail-archive.com/dev@httpd.apache.org/msg37727.html

The same patchset can be used for 2.2.x branch pretty much as is with
the single addition of backporting the apr_socket_sendto function from
trunk (it's broken in the APR that ships with 2.2.x)

If you have any issues applying it/using it/integrating with mod_per
(though I don't think the mod_perl API should need any tweaking to
utilize this), I'd be happy to work with you (or whomever else).

With ApacheCon & the hackathon coming up soon, this would be a great
time to ping dev@httpd for possible inclusion in trunk...

  Issac

Rolf Banting wrote:
> Hi,
> 
> I'd like to able to transplant a kind of gateway app I have written
> from a POE to mod_perl2. Why? Well mainly so I have an excuse to get
> into mod_perl2 & apache.
> 
> What the app does is accept client requests in a proprietrary protocol
> carried over UDP and translate them either into synchronous CORBA
> calls or asynchronous requests over the proprietrary protocol to an
> external server. In turn server repsonses are then translated and sent
> back to the original client.
> 
> I have scanned the mail archives and found references to some UDP
> based work that different people were doing but I can't see if
> anything got released.
> 
> Did the mod_udp development get into release mode or are there other
> ways to get mod_perl to listen to UDP ?
> 
> Thanks in advance,
> 
> Rolf