httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tony Finch <...@dotat.at>
Subject Re: apr_sockaddr_t
Date Fri, 10 Nov 2000 02:50:20 GMT

David Reid <dreid@jetnet.co.uk> wrote:
>+
>+/* we're going to roll our own sockaddr type as we want to make sure
>+ * we have protocol independance for APR...
>+ *
>+ * It's defined here as I think it should all be platform safe...
>+ */
>+typedef struct {
>+    apr_pool_t *cont;              /* The pool to use... */
>+    char *hostname;                /* The hostname */
>+    char *port_str;                /* String representation of port */
>+    apr_port_t port;               /* numeric port */
>+    union {
>+        struct sockaddr_in sin;    /* IPv4 sockaddr structure */
>+#if APR_HAVE_IPV6
>+        struct sockaddr_in6 sin6;  /* IPv6 sockaddr structure */
>+#endif
>+    } sa;
>+    apr_socklen_t sa_len;          /* How big is the sockaddr we're using?
>*/
>+    int addr_len;                  /* How big should the address buffer be?
>+                                    * 16 for v4 or 48 for v6
>+                                    * used in inet_ntop...
>+                                    */
>+} apr_sockaddr_t;

That looks absurdly baroque to me. Why is the hostname there? I think
name <-> address translations should be handled at a higher level than
sockaddrs. Why duplicate the port?

Tony.
-- 
en oeccget g mtcaa    f.a.n.finch
v spdlkishrhtewe y    dot@dotat.at
eatp o v eiti i d.    fanf@covalent.net

Mime
View raw message