httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeff Trawick <trawi...@bellsouth.net>
Subject Re: apr_sockaddr_t
Date Fri, 10 Nov 2000 14:45:39 GMT
"David Reid" <dreid@jetnet.co.uk> writes:

> Ahh, yes you're right on the sin_family...
> 
> > 
> > perhaps the offset to the port and a macro to encapsulate the use of
> > it would be useful...  we don't need the pointer to the family...
> 
> Can I take that as a +1 for adding the structure?

Sure (+1)...  

Some minor suggestions...

>+    apr_pool_t *cont;              /* The pool to use... */

  Consider renaming field "cont" to "p" or "pool"

>+    int addr_len;                  /* How big should the address buffer be?
>+                                    * 16 for v4 or 48 for v6
>+                                    * used in inet_ntop...
>+                                    */

  Consider renaming addr_len to addr_str_len

>+    char *port_str;                /* String representation of port
>*/

  Consider reserving space for the port string directly in the
  apr_sockaddr_t:

      char port_str[6];

  (think of padding added by some compilers: it may not take more
  space in the structure and it simplifies the code a bit)

-- 
Jeff Trawick | trawick@ibm.net | PGP public key at web site:
     http://www.geocities.com/SiliconValley/Park/9289/
          Born in Roswell... married an alien...

Mime
View raw message