rename InitEventIO to EvConnectSock, since this suits better what this function does...
authorWilfried Goesgens <dothebart@citadel.org>
Sun, 25 Dec 2011 15:57:29 +0000 (16:57 +0100)
committerWilfried Goesgens <dothebart@citadel.org>
Sun, 25 Dec 2011 15:57:29 +0000 (16:57 +0100)
citadel/event_client.c
citadel/event_client.h
citadel/modules/network/serv_networkclient.c
citadel/modules/pop3client/serv_pop3client.c
citadel/modules/smtp/serv_smtpeventclient.c

index 27e8a8146ff9641a651982c06aaed0ddab5ac215..4a2f481a9cafc2412cc7c8fd2ed3b6d8e2a7e2aa 100644 (file)
@@ -700,11 +700,26 @@ IO_postdns_callback(struct ev_loop *loop, ev_idle *watcher, int revents)
        }
 }
 
-eNextState event_connect_socket(AsyncIO *IO, double conn_timeout, double first_rw_timeout)
+
+eNextState EvConnectSock(AsyncIO *IO, 
+                        void *pData, 
+                        double conn_timeout, 
+                        double first_rw_timeout,
+                        int ReadFirst)
 {
        int fdflags; 
        int rc = -1;
 
+       IO->Data = pData;
+       become_session(IO->CitContext);
+       
+       if (ReadFirst) {
+               IO->NextState = eReadMessage;
+       }
+       else {
+               IO->NextState = eSendReply;
+       }
+
        IO->SendBuf.fd = IO->RecvBuf.fd = 
                socket(
                        (IO->ConnectMe->IPv6)?PF_INET6:PF_INET, 
@@ -790,23 +805,6 @@ void SetNextTimeout(AsyncIO *IO, double timeout)
        ev_timer_again (event_base,  &IO->rw_timeout);
 }
 
-eNextState InitEventIO(AsyncIO *IO, 
-                      void *pData, 
-                      double conn_timeout, 
-                      double first_rw_timeout,
-                      int ReadFirst)
-{
-       IO->Data = pData;
-       become_session(IO->CitContext);
-       
-       if (ReadFirst) {
-               IO->NextState = eReadMessage;
-       }
-       else {
-               IO->NextState = eSendReply;
-       }
-       return event_connect_socket(IO, conn_timeout, first_rw_timeout);
-}
 
 eNextState ReAttachIO(AsyncIO *IO, 
                      void *pData, 
index 0b71c743e02833f1ed4becc4812498ea88a8aed4..c8a4bafe3e41eeb02220b9dfbed8c5ed992de30e 100644 (file)
@@ -165,11 +165,11 @@ eNextState QueueDBOperation(AsyncIO *IO, IO_CallBack CB);
 eNextState QueueEventContext(AsyncIO *IO, IO_CallBack CB);
 eNextState QueueCurlContext(AsyncIO *IO);
 
-eNextState InitEventIO(AsyncIO *IO, 
-                      void *pData, 
-                      double conn_timeout, 
-                      double first_rw_timeout,
-                      int ReadFirst);
+eNextState EvConnectSock(AsyncIO *IO, 
+                        void *pData, 
+                        double conn_timeout, 
+                        double first_rw_timeout,
+                        int ReadFirst);
 void IO_postdns_callback(struct ev_loop *loop, ev_idle *watcher, int revents);
 
 int QueueQuery(ns_type Type, const char *name, AsyncIO *IO, DNSQueryParts *QueryParts, IO_CallBack PostDNS);
index 338425e760b8b17279dae18d1dbb02606ffff197..d0e9e6d197afd729d7ab38660907affe0e1b971c 100644 (file)
@@ -789,10 +789,10 @@ eNextState nwc_connect_ip(AsyncIO *IO)
               ChrPtr(NW->host),
               ChrPtr(NW->port));
        
-       return InitEventIO(IO, NW, 
-                          NWC_ConnTimeout, 
-                          NWC_ReadTimeouts[0],
-                          1);
+       return EvConnectSock(IO, NW, 
+                            NWC_ConnTimeout, 
+                            NWC_ReadTimeouts[0],
+                            1);
 }
 
 void RunNetworker(AsyncNetworker *NW)
index e20f16f70aabd19a4ecb6e0e9ec64c8b301b42f1..8a0d23c38f6c64537d9d2f44573082169509a43a 100644 (file)
@@ -766,10 +766,10 @@ eNextState pop3_connect_ip(AsyncIO *IO)
 
        /////// SetConnectStatus(IO);
 
-       return InitEventIO(IO, cpptr, 
-                          POP3_C_ConnTimeout, 
-                          POP3_C_ReadTimeouts[0],
-                          1);
+       return EvConnectSock(IO, cpptr, 
+                            POP3_C_ConnTimeout, 
+                            POP3_C_ReadTimeouts[0],
+                            1);
 }
 
 eNextState pop3_get_one_host_ip_done(AsyncIO *IO)
index 8e0d091326459f445ab5da53191dbcef658b5c47..af5d12d9467328f4ac9f2bb51fb32b07efcbd2a0 100644 (file)
@@ -264,10 +264,10 @@ eNextState mx_connect_ip(AsyncIO *IO)
 
        SetConnectStatus(IO);
 
-       return InitEventIO(IO, SendMsg, 
-                          SMTP_C_ConnTimeout, 
-                          SMTP_C_ReadTimeouts[0],
-                          1);
+       return EvConnectSock(IO, SendMsg, 
+                            SMTP_C_ConnTimeout, 
+                            SMTP_C_ReadTimeouts[0],
+                            1);
 }
 
 eNextState get_one_mx_host_ip_done(AsyncIO *IO)