X-Git-Url: https://code.citadel.org/?p=citadel.git;a=blobdiff_plain;f=citadel%2Fmodules%2Feventclient%2Fserv_eventclient.c;fp=citadel%2Fmodules%2Feventclient%2Fserv_eventclient.c;h=55d6fe6f217f043240edadb2febc8b76b66d9faa;hp=22a715615c6ffac6aa32629eb857b657f5fa60ba;hb=08932aebd49f355220da46a3e1ea58d569e46a95;hpb=1587876ced7272533c1cd866789938978bc54318 diff --git a/citadel/modules/eventclient/serv_eventclient.c b/citadel/modules/eventclient/serv_eventclient.c index 22a715615..55d6fe6f2 100644 --- a/citadel/modules/eventclient/serv_eventclient.c +++ b/citadel/modules/eventclient/serv_eventclient.c @@ -147,7 +147,7 @@ gotstatus(int nnrun) EVCURLM_syslog(LOG_DEBUG, "request complete\n"); - IO->Now = ev_now(event_base); + IO->CitContext->lastcmd = IO->Now = ev_now(event_base); ev_io_stop(event_base, &IO->recv_event); ev_io_stop(event_base, &IO->send_event); @@ -181,6 +181,7 @@ gotstatus(int nnrun) curl_slist_free_all(IO->HttpReq.headers); + IO->HttpReq.headers = NULL; msta = curl_multi_remove_handle(global.mhnd, chnd); if (msta) EVCURL_syslog(LOG_ERR, @@ -282,7 +283,7 @@ gotdata(void *data, size_t size, size_t nmemb, void *cglobal) { IO->HttpReq.ReplyData = NewStrBufPlain(NULL, SIZ); } - IO->Now = ev_now(event_base); + IO->CitContext->lastcmd = IO->Now = ev_now(event_base); return CurlFillStrBuf_callback(data, size, nmemb, @@ -343,7 +344,7 @@ gotwatchsock(CURL *easy, } SetEVState(IO, eCurlGotIO); - IO->Now = ev_now(event_base); + IO->CitContext->lastcmd = IO->Now = ev_now(event_base); Action = ""; switch (action) @@ -502,10 +503,11 @@ static void IOcurl_abort_shutdown_callback(struct ev_loop *loop, return; SetEVState(IO, eCurlShutdown); - IO->Now = ev_now(event_base); + IO->CitContext->lastcmd = IO->Now = ev_now(event_base); EVCURL_syslog(LOG_DEBUG, "EVENT Curl: %s\n", __FUNCTION__); curl_slist_free_all(IO->HttpReq.headers); + IO->HttpReq.headers = NULL; msta = curl_multi_remove_handle(global.mhnd, IO->HttpReq.chnd); if (msta) { @@ -523,6 +525,7 @@ static void IOcurl_abort_shutdown_callback(struct ev_loop *loop, assert(IO->ShutdownAbort); IO->ShutdownAbort(IO); } + eNextState evcurl_handle_start(AsyncIO *IO) { @@ -648,7 +651,7 @@ static void QueueEventAddCallback(EV_P_ ev_async *w, int revents) Ctx = h->IO->CitContext; become_session(Ctx); - h->IO->Now = Now; + h->IO->CitContext->lastcmd = h->IO->Now = Now; switch (h->EvAttch(h->IO)) { case eReadMore: @@ -798,7 +801,7 @@ static void DBQueueEventAddCallback(EV_P_ ev_async *w, int revents) IOID = h->IO->ID; if (h->IO->StartDB == 0.0) h->IO->StartDB = Now; - h->IO->Now = Now; + h->IO->CitContext->lastcmd = h->IO->Now = Now; SetEVState(h->IO, eDBAttach); Ctx = h->IO->CitContext;