]> code.citadel.org Git - citadel.git/blobdiff - citadel/event_client.c
libev/c-ares migration: unstack out ouf c-ares before querying new requests
[citadel.git] / citadel / event_client.c
index 60f74282df813cee217614d2ba6af44c1b8e4403..b45367d08f71ac784ad9960c2602a34f8fbbe916 100644 (file)
@@ -336,7 +336,12 @@ IO_recv_callback(struct ev_loop *loop, ev_io *watcher, int revents)
        }
 }
 
-
+void
+IO_postdns_callback(struct ev_loop *loop, ev_timer *watcher, int revents)
+{
+       AsyncIO *IO = watcher->data;
+       IO->PostDNS(IO);
+}
 
 eNextState event_connect_socket(AsyncIO *IO, double conn_timeout, double first_rw_timeout)
 {
@@ -384,9 +389,9 @@ eNextState event_connect_socket(AsyncIO *IO, double conn_timeout, double first_r
        IO->conn_fail.data = IO;
        ev_timer_init(&IO->rw_timeout, IO_Timout_callback, first_rw_timeout, 0);
        IO->rw_timeout.data = IO;
-       ///struct sockaddr_in *addr = &IO->Addr;
+
        if (IO->IP6)
-               rc = connect(IO->sock, &IO->Addr, sizeof(struct in6_addr));
+               rc = connect(IO->sock, &IO->Addr, sizeof(struct sockaddr_in6));
        else
                rc = connect(IO->sock, (struct sockaddr_in *)&IO->Addr, sizeof(struct sockaddr_in));