]> granicus.if.org Git - libevent/commitdiff
be: replace sockaddr_storage with sockaddr_in6 for conn_address
authorAzat Khuzhin <a3at.mail@gmail.com>
Tue, 2 Dec 2014 11:24:19 +0000 (14:24 +0300)
committerAzat Khuzhin <a3at.mail@gmail.com>
Tue, 18 Aug 2015 17:06:53 +0000 (20:06 +0300)
We need only ipv6/ipv4 for connect in bufferevent, and since
sockaddr_storage is pretty big (128 bytes) it will be better to use
sockaddr_in6 here (it will fit ipv4 too).

bufferevent-internal.h

index d2fea2326a9d09b173ed199562ec3e01029a48d9..fb5e6a695c995e02cf27cc9848eaaf482fcced22 100644 (file)
@@ -213,7 +213,10 @@ struct bufferevent_private {
         * So we need to save it, just after we connected to remote server, or
         * after resolving (to avoid extra dns requests during retrying, since UDP
         * is slow) */
-       struct sockaddr_storage conn_address;
+       union {
+               struct sockaddr_in6 in6;
+               struct sockaddr_in in;
+       } conn_address;
 };
 
 /** Possible operations for a control callback. */