In trying to write a protocol module for a protocol type != TCP, I had to duplicate the logic of both alloc_listener and find_default_family from server/listen.c.
I believe that if a module wants to push a new listener socket on ap_listeners, the module should simply do:
ap_alloc_listener(process, hostname, port, type);
+1 in concept
The following patch exposes alloc_listener as ap_alloc_listener and takes an extra type argument.
Index: server/listen.c =================================================================== RCS file: /home/cvspublic/httpd-2.0/server/listen.c,v retrieving revision 1.84 diff -u -b -B -r1.84 listen.c --- server/listen.c 22 Nov 2002 12:23:10 -0000 1.84 +++ server/listen.c 3 Feb 2003 12:10:27 -0000 @@ -266,8 +266,7 @@ #endif }
-
-static const char *alloc_listener(process_rec *process, char *addr, apr_port_t port)
+const char *ap_alloc_listener(process_rec *process, char *addr, apr_port_t port, int type)
you need to use AP_DECLARE here too, as in
AP_DECLARE(const char *) ap_alloc_listener(blah blah blah)
