httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Issac Goldstand <mar...@beamartyr.net>
Subject Re: [RFC] Adding UDP support to server
Date Sun, 25 Feb 2007 08:52:01 GMT
Jean-Frederic wrote:
> On Tue, 2007-02-20 at 15:14 +0200, Issac Goldstand wrote:
>> I'm working on a protocol module for Apache 2.2 and ran into the lack of
>> UDP support in httpd.  I'd like to try and remedy the situation in a
>> manner best suited for merging to trunk + backporting where possible.  I
>> know that people have asked about it in the past, and if we really want
>> to be "d", we need support beyond TCP/SOCK_STREAM sockets.
> 
> Having UDP support doesn't sound a bad idea.
> 
> You don't need to change all the worker stuff. Just set accept_funct =
> to a dummy fonction for UPD sockets in make_sock().

That's possible, but we'd need to muck with the MPMs anyway.  Although I
neglected to include it in my previous post, not all MPMs use an
accept_func and those that don't also need to be modified to provide the
option of not calling apr_socket_accept [or alternatively, have the MPMs
silently ignore a EOPNOTSUPP error returned from the underlying accept()
call, if that's portable and deemed "safe"]

> You don't need to do anything in  dummy_connection() when using a UPD
> socket. 

In general, I think the entire accept_func is not currently implemented
so well; the idea is to provide a flexible way to control how a TCP
connection is accept()ed, yet each MPM that uses it pretty much
hardcodes its use anyway (with the single exception of per-child on
trunk, which changes it at run-time).

If we're looking to do the UDP thing right, I'd suggest changing the way
accept_func works to be either an APR_OPTIONAL_FN or, better yet, an
AP_HOOK, and for MPMs to exclusively call the socket's accept_func (in
either case, the default TCP accept_func would just wrap
apr_socket_accept - it could also handle non-TCP functions by not
calling apr_socket_accept if apr_socket_type_get != SOCK_STREAM).

  Issac

Mime
View raw message