projects
/
citadel.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
5268c0a
)
rename InitEventIO to EvConnectSock, since this suits better what this function does...
author
Wilfried Goesgens
<dothebart@citadel.org>
Sun, 25 Dec 2011 15:57:29 +0000
(16:57 +0100)
committer
Wilfried Goesgens
<dothebart@citadel.org>
Sun, 25 Dec 2011 15:57:29 +0000
(16:57 +0100)
citadel/event_client.c
patch
|
blob
|
history
citadel/event_client.h
patch
|
blob
|
history
citadel/modules/network/serv_networkclient.c
patch
|
blob
|
history
citadel/modules/pop3client/serv_pop3client.c
patch
|
blob
|
history
citadel/modules/smtp/serv_smtpeventclient.c
patch
|
blob
|
history
diff --git
a/citadel/event_client.c
b/citadel/event_client.c
index 27e8a8146ff9641a651982c06aaed0ddab5ac215..4a2f481a9cafc2412cc7c8fd2ed3b6d8e2a7e2aa 100644
(file)
--- a/
citadel/event_client.c
+++ b/
citadel/event_client.c
@@
-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;
{
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,
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);
}
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,
eNextState ReAttachIO(AsyncIO *IO,
void *pData,
diff --git
a/citadel/event_client.h
b/citadel/event_client.h
index 0b71c743e02833f1ed4becc4812498ea88a8aed4..c8a4bafe3e41eeb02220b9dfbed8c5ed992de30e 100644
(file)
--- a/
citadel/event_client.h
+++ b/
citadel/event_client.h
@@
-165,11
+165,11
@@
eNextState QueueDBOperation(AsyncIO *IO, IO_CallBack CB);
eNextState QueueEventContext(AsyncIO *IO, IO_CallBack CB);
eNextState QueueCurlContext(AsyncIO *IO);
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);
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);
diff --git
a/citadel/modules/network/serv_networkclient.c
b/citadel/modules/network/serv_networkclient.c
index 338425e760b8b17279dae18d1dbb02606ffff197..d0e9e6d197afd729d7ab38660907affe0e1b971c 100644
(file)
--- a/
citadel/modules/network/serv_networkclient.c
+++ b/
citadel/modules/network/serv_networkclient.c
@@
-789,10
+789,10
@@
eNextState nwc_connect_ip(AsyncIO *IO)
ChrPtr(NW->host),
ChrPtr(NW->port));
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)
}
void RunNetworker(AsyncNetworker *NW)
diff --git
a/citadel/modules/pop3client/serv_pop3client.c
b/citadel/modules/pop3client/serv_pop3client.c
index e20f16f70aabd19a4ecb6e0e9ec64c8b301b42f1..8a0d23c38f6c64537d9d2f44573082169509a43a 100644
(file)
--- a/
citadel/modules/pop3client/serv_pop3client.c
+++ b/
citadel/modules/pop3client/serv_pop3client.c
@@
-766,10
+766,10
@@
eNextState pop3_connect_ip(AsyncIO *IO)
/////// SetConnectStatus(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)
}
eNextState pop3_get_one_host_ip_done(AsyncIO *IO)
diff --git
a/citadel/modules/smtp/serv_smtpeventclient.c
b/citadel/modules/smtp/serv_smtpeventclient.c
index 8e0d091326459f445ab5da53191dbcef658b5c47..af5d12d9467328f4ac9f2bb51fb32b07efcbd2a0 100644
(file)
--- a/
citadel/modules/smtp/serv_smtpeventclient.c
+++ b/
citadel/modules/smtp/serv_smtpeventclient.c
@@
-264,10
+264,10
@@
eNextState mx_connect_ip(AsyncIO *IO)
SetConnectStatus(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)
}
eNextState get_one_mx_host_ip_done(AsyncIO *IO)