httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Manoj Kasichainula <ma...@io.com>
Subject APR network API
Date Thu, 27 Apr 2000 00:14:58 GMT
OK, my case for changing the APR networking API to look more like BSD
sockets, which can also just be interpreted as general whining about
what's there now:

1. We're storing IP addresses as strings. Why? I don't like this,
because we have to deal with the overhead of string conversion, and it
just feels evil.

BTW, we're using inet_ntoa() to do these conversions in Apache, which
is not thread safe. We need an inet_ntoa() replacement anyway, though
(Linux has a very interesting solution where it uses a macro that gets
used in a printf call).

2. The get/set API for socket calls just seems wrong. This:

ap_set_local_port(sd, port);
ap_set_local_ipaddr(sd, addr);
ap_bind(sd);

just seems so much more convuluted than:

bind(sd, addr, port);

The former is like some sort of load-store assembly language.

Also, I don't think there should be an API for setting the local and
remote port for an already established socket.

3. I don't think we should be doing implicit DNS lookups. We're doing
so now, for example in ap_connect. It would be really cool if we could
eliminate all DNS lookups from the Apache core in fact, and skip the
whole async DNS issue entirely.

4. Looking like the BSD socket API means we have far shorter, simpler
code for all platforms that are using BSD socket-like calls. AFAIK,
that's most of them. And I don't think that anyone's socket calls look
like the current APR ones, so we don't shaft anyone in the process.

5. The BSD socket API is familiar to just about all TCP/IP
programmers. We'll have less of a learning curve if we stick with
something similar to BSD.


Mime
View raw message