apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Issac Goldstand <mar...@beamartyr.net>
Subject [patch] experimental UDP support in httpd-prefork/apr/apr-util trunk
Date Wed, 05 Sep 2007 10:18:45 GMT
After taking my own advice on Sunday, I reworked everything I'd done for
UDP support and focused on allowing the core I/O filters to work with
non-connected sockets.  I'm happy to report that I've come up with a
working prototype for prefork that doesn't require substantial amounts
of mucking with the MPM code.  It requires patches to APR (to add a
apr_socket_sendtov function, needed by the core output filter) and
APR-Util to support apr_socket_readfrom in socket buckets that aren't
connected).  Both of these patches would be useful in APR/APR-Util
regardles (although the APR patch still requires work for win32, beos
and netware - I suppose I'll tackle at least win32 [which I'm familiar
with] later today and we'll see about the others).  As such, I've added
these both to bugzilla to
https://issues.apache.org/bugzilla/show_bug.cgi?id=43309 and
https://issues.apache.org/bugzilla/show_bug.cgi?id=43302, respectively.

To go through what I've done in the main patch (for those who want an
idea of what they're looking at):

* Export ap_alloc_listner and take socket type/protocol as arguments
* In core_create_conn, if the remote_addr of the socket can't be
detected from the socket, try to run recvfrom in PEEK mode to get the
peer address
* Core input filters run as-is (patch to apr-util does everything)
* Core output filter tries (in init) to see if socket is connected.  If
not, it turns of a new flag, connected, in ctx which is ultimately used
to decide whether to pass data to apr_socket_sendv or apr_socket_sendtov
* Additionally, disable SENDFILE for non-stream sockets
* Create ListenUDP config directive to create UDP listeners
* Alter all MPMs to only call lr->accept_func if it's defined
* In prefork, re-create the pollset in every iteration of child_main.
Hack the use of lr->active to add a flag (value 2) for in-use UDP sockets


Mime
View raw message