Re: It's that time of the year again
Quoting Ian Holsman [EMAIL PROTECTED]: ideas so far (half joking): - mod_ircd - implementing a UDP protocol - a caching module implement CML (cache-meta-language) - a SEDA type MPM http://www.kegel.com/c10k.html I think a SoC project that profiles Apache (and finds out where we fall short) so that we are able to compete with other lightweight HTTP servers popping up these days would be a good endeavor for any CS student. This seems to be more viable for our threaded MPMs. For the prefork MPM, maybe a goal for 10,000 connections might be impractical. I haven't done any benchmarks myself, I've just read results so anyone correct me if I'm wrong. Rian
prefork mpm in linux: ap_process_connection isn't called on connection
Hey All, On the httpd trunk in prefork.c ap_process_connection isn't called until there is data on the new connection (instead of just when a client connects). I don't know if this is the intended behavior but from what I can see this is because the poll descriptor is set to poll on POLL_IN, in apr_poll.h: #define APR_POLLIN0x001 /** Can read without blocking */ On a new connection event there is no guarantee to be able to read without blocking, so I think the intended behavior is to stop blocking only when there is data on the new connection. For the HTTP protocol either behavior works, for other protocols ap_process_connection should be called immediately when a client connects (for instance SMTP, where it is mandatory for the server to send data first). Actually this is indeed what happens in BSD variants. I don't intend to post a bug without a fix but currently there is no APR_POLLCONNECTION (or something similar) in apr. What should be done? Rian
APR resolver?
While implementing the message bounce in mod_smtpd I ran into a snag. I need to get mx records for host names!! There seems to be no portable DNS resolver library/interface. For UNIX there is at least res_search() and dn_expand() except on BSD this is in the standard library and in linux you need -lresolv. I know there is apr_sockaddr_info_get but this doesn't handle getting mx records (or other DNS record types). Should a resolver API be added to APR. Actually I think yes and I think I'm going to implement this. Any objections? Rian
mod_smtpd filter support
Hi, I just checked in support for input filters and header parsing in mod_smtpd. This currently means little since there is no documentation on how to use mod_smtpd or many example plugins. In the next few days (once I receive power) I will have a couple of example plugins checked in (regular expression vrfy, postfix queuer) and some minor documentation (maybe a tutorial + tutorial plugin). mod_smtpd now also depends on libapreq2 for rfc822 header parsing (configure does not yet check if this is installed, patches welcome!!). This mostly means that mod_smtpd is very close to completion. I expect some bug-fixes and I plan on adding a one-recipient/one-transaction feature and a message body reading abstraction, but other than that it seems to be in its final working state. Features include: - Hooks on every important SMTP event, with pre-done logic to handle denies and disconnections. - DATA command input filter support per transaction. - RFC822 Header parsing via libapreq2 - Exported IO functions. Have Fun! -rian
Re: mod_smtpd design.
Quoting Garrett Rooney [EMAIL PROTECTED]: Rian Hunter wrote: type misc_smtp_handler(request_rec *r) { smtpd_request_rec *smtp_data; if (strncmp(http, r-protocol_name, 4)) { // decline to handle, this module doesn't handle // http requests. } //then get smtpd specific data smtp_data = get_smtpd_request(r); // do some handlin' } The advantage to this approach is a less bulky (but more all encompassing) request_rec with support for an arbitrary amount of protocols and protocol specific data. Rather than inserting dozens of strcmps all throught the processing, I'd prefer to store an int identifying the protocol, and just have a simple compare. No reason to burn CPU on the strcmp if we don't have to. -garrett The reason I suggested a strcmp is that it gives freedom to module developers to set and implement any protocol they like. Doing integer comparisons would require us to maintain a list of official integer-protocol mappings, but there may be other ways to approach it without having that constraint. Maybe we can use the official iana port description list to specifiy protocols like 80 means http, 25 means smtp, 143 means imap etc. -rian