Return-Path: Delivered-To: apmail-httpd-dev-archive@httpd.apache.org Received: (qmail 87954 invoked by uid 500); 15 Jul 2003 12:32:33 -0000 Mailing-List: contact dev-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@httpd.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list dev@httpd.apache.org Received: (qmail 87928 invoked from network); 15 Jul 2003 12:32:33 -0000 Message-ID: <3F13F3CD.3070409@attglobal.net> Date: Tue, 15 Jul 2003 08:30:05 -0400 From: Jeff Trawick Reply-To: trawick@attglobal.net User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030624 X-Accept-Language: en-us, en MIME-Version: 1.0 To: dev@httpd.apache.org Subject: Re: [PATCH] UDP Listeners (was Re: DNS+HTTP redirection system inside an Apache module) References: <3F137E1D.7040702@apache.org> In-Reply-To: <3F137E1D.7040702@apache.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Ian Holsman wrote: > I would like to commit your UDP listener patch to apache 2.1's source tree. > > (providing other people don't have any major objections) I'm at a loss as to what the big picture is with the programming model enabled by this path. I could go read the whole "DNS+HTTP redirection system" but I'd rather not :) How does process_func field ever get set? What type of MPM thread would be used to process the UDP -- the type of thread that polls on sockets or the type of thread that processes work. It doesn't fit well within the rest of Apache to assume that the "accept"-ing thread should process the message. Why does ap_old_listeners need to be externalized? About this code below: It seems like process_func is a flag that means ????? (I dunno; why wouldn't we be using the existing record here). Is that inherently connected to having a process_func, or are those separate issues? /* Some listeners are not real so they will not have a bind_addr. */ if (sa) { apr_sockaddr_port_get(&oldport, sa); ! if (!strcmp(sa->hostname, addr) && port == oldport && !(*walk)->process_func) { /* re-use existing record */ new = *walk; *walk = new->next; Regarding the code below: Setting a key in a pool is not an appropriate way to get Apache to do some special processing on a socket. Surely the problem is that Apache doesn't have quite the right hook currently and an existing hook needs to be modified in Apache 2.1-dev or some new hook is needed? { apr_status_t rv; ! conn_rec *c; ! ap_listen_rec * lr = NULL; ! ! rv = apr_pool_userdata_get((void**)&lr,AP_LISTEN_REC_KEY,ptrans); ! if (rv == APR_SUCCESS && lr && lr->process_func) { ! apr_pool_userdata_set(NULL,AP_LISTEN_REC_KEY,NULL,ptrans); ! lr->process_func(csd,lr,server,ptrans); ! return NULL; ! }