/*
- * Copyright (c) 1998-2012 by the citadel.org team
+ * Copyright (c) 1998-2015 by the citadel.org team
*
- * This program is open source software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 3.
- *
- *
+ * This program is open source software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 3.
*
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- *
- *
- *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
*/
#include "sysdep.h"
#include "server.h"
#include "citserver.h"
#include "support.h"
-
#include "ctdl_module.h"
-
+#include "config.h"
#include "event_client.h"
#include "serv_curl.h"
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);
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,
{
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,
}
SetEVState(IO, eCurlGotIO);
- IO->Now = ev_now(event_base);
+ IO->CitContext->lastcmd = IO->Now = ev_now(event_base);
Action = "";
switch (action)
OPT(WRITEDATA, (void *)IO);
OPT(ERRORBUFFER, IO->HttpReq.errdesc);
- if ((!IsEmptyStr(config.c_ip_addr))
- && (strcmp(config.c_ip_addr, "*"))
- && (strcmp(config.c_ip_addr, "::"))
- && (strcmp(config.c_ip_addr, "0.0.0.0"))
+ if ((!IsEmptyStr(CtdlGetConfigStr("c_ip_addr")))
+ && (strcmp(CtdlGetConfigStr("c_ip_addr"), "*"))
+ && (strcmp(CtdlGetConfigStr("c_ip_addr"), "::"))
+ && (strcmp(CtdlGetConfigStr("c_ip_addr"), "0.0.0.0"))
)
{
- OPT(INTERFACE, config.c_ip_addr);
+ OPT(INTERFACE, CtdlGetConfigStr("c_ip_addr"));
}
#ifdef CURLOPT_HTTP_CONTENT_DECODING
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)
{
assert(IO->ShutdownAbort);
IO->ShutdownAbort(IO);
}
+
eNextState
evcurl_handle_start(AsyncIO *IO)
{
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:
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;