X-Git-Url: https://code.citadel.org/?p=citadel.git;a=blobdiff_plain;f=citadel%2Fevent_client.c;h=4a2f481a9cafc2412cc7c8fd2ed3b6d8e2a7e2aa;hp=27e8a8146ff9641a651982c06aaed0ddab5ac215;hb=cf7cb2463d47a4a9ed36c8d1c13f188418389437;hpb=5268c0a9bf8202336b9e3e8b86f45d9d010f2811 diff --git a/citadel/event_client.c b/citadel/event_client.c index 27e8a8146..4a2f481a9 100644 --- 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; + 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,