- CtdlLogPrintf(CTDL_ERR, "EVCURL: error setting option " #s " on curl multi handle: %s\n", curl_easy_strerror(sta)); \
+ syslog(LOG_ERR, "EVCURL: error setting option " #s " on curl multi handle: %s\n", curl_easy_strerror(sta)); \
- CtdlLogPrintf(CTDL_ERR, "EVCURL: error asking curl for private cookie of curl handle: %s\n", curl_easy_strerror(sta));
+ syslog(LOG_ERR, "EVCURL: error asking curl for private cookie of curl handle: %s\n", curl_easy_strerror(sta));
- CtdlLogPrintf(CTDL_ERR, "EVCURL: error description: %s\n", IO->HttpReq.errdesc);
- CtdlLogPrintf(CTDL_ERR, "EVCURL: error performing request: %s\n", curl_easy_strerror(sta));
+ syslog(LOG_ERR, "EVCURL: error description: %s\n", IO->HttpReq.errdesc);
+ syslog(LOG_ERR, "EVCURL: error performing request: %s\n", curl_easy_strerror(sta));
- CtdlLogPrintf(CTDL_ERR, "EVCURL: error asking curl for response code from request: %s\n", curl_easy_strerror(sta));
- CtdlLogPrintf(CTDL_ERR, "EVCURL: http response code was %ld\n", (long)IO->HttpReq.httpcode);
+ syslog(LOG_ERR, "EVCURL: error asking curl for response code from request: %s\n", curl_easy_strerror(sta));
+ syslog(LOG_ERR, "EVCURL: http response code was %ld\n", (long)IO->HttpReq.httpcode);
- CtdlLogPrintf(CTDL_ERR, "EVCURL: warning problem detaching completed handle from curl multi: %s\n", curl_multi_strerror(msta));
+ syslog(LOG_ERR, "EVCURL: warning problem detaching completed handle from curl multi: %s\n", curl_multi_strerror(msta));
return;
}
msta = curl_multi_socket_action(global->mhnd, fd, 0, &nnrun);
return;
}
msta = curl_multi_socket_action(global->mhnd, fd, 0, &nnrun);
- CtdlLogPrintf(CTDL_ERR, "EVCURL: error in curl processing events on multi handle, fd %d: %s\n", (int)fd, curl_multi_strerror(msta));
+ syslog(LOG_ERR, "EVCURL: error in curl processing events on multi handle, fd %d: %s\n", (int)fd, curl_multi_strerror(msta));
if (global->nrun != nnrun)
gotstatus(global, nnrun);
}
static void
gottime(struct ev_loop *loop, ev_timer *timeev, int events) {
if (global->nrun != nnrun)
gotstatus(global, nnrun);
}
static void
gottime(struct ev_loop *loop, ev_timer *timeev, int events) {
evcurl_global_data *global = (void *)timeev->data;
stepmulti(global, CURL_SOCKET_TIMEOUT);
}
static void
gotio(struct ev_loop *loop, ev_io *ioev, int events) {
evcurl_global_data *global = (void *)timeev->data;
stepmulti(global, CURL_SOCKET_TIMEOUT);
}
static void
gotio(struct ev_loop *loop, ev_io *ioev, int events) {
sockwatcher_data *sockwatcher = (void *)ioev->data;
stepmulti(sockwatcher->global, ioev->fd);
}
sockwatcher_data *sockwatcher = (void *)ioev->data;
stepmulti(sockwatcher->global, ioev->fd);
}
gotdata(void *data, size_t size, size_t nmemb, void *cglobal) {
AsyncIO *IO = (AsyncIO*) cglobal;
//evcurl_request_data *D = (evcurl_request_data*) data;
gotdata(void *data, size_t size, size_t nmemb, void *cglobal) {
AsyncIO *IO = (AsyncIO*) cglobal;
//evcurl_request_data *D = (evcurl_request_data*) data;
evcurl_global_data *global = cglobal;
ev_timer_stop(EV_DEFAULT, &global->timeev);
if (tblock_ms < 0 || 14000 < tblock_ms)
evcurl_global_data *global = cglobal;
ev_timer_stop(EV_DEFAULT, &global->timeev);
if (tblock_ms < 0 || 14000 < tblock_ms)
- CtdlLogPrintf(CTDL_DEBUG,"EVCURL: gotwatchsock called fd=%d action=%d\n", (int)fd, action);
+ syslog(LOG_DEBUG, "EVCURL: gotwatchsock called fd=%d action=%d\n", (int)fd, action);
sockwatcher = malloc(sizeof(sockwatcher_data));
sockwatcher->global = global;
ev_init(&sockwatcher->ioev, &gotio);
sockwatcher = malloc(sizeof(sockwatcher_data));
sockwatcher->global = global;
ev_init(&sockwatcher->ioev, &gotio);
curl_multi_assign(mhnd, fd, sockwatcher);
}
if (CURL_POLL_REMOVE == action) {
curl_multi_assign(mhnd, fd, sockwatcher);
}
if (CURL_POLL_REMOVE == action) {
IO->HttpReq.attached = 0;
IO->SendDone = CallBack;
IO->Terminate = Terminate;
chnd = IO->HttpReq.chnd = curl_easy_init();
if (!chnd)
{
IO->HttpReq.attached = 0;
IO->SendDone = CallBack;
IO->Terminate = Terminate;
chnd = IO->HttpReq.chnd = curl_easy_init();
if (!chnd)
{
OPT(INTERFACE, config.c_ip_addr);
}
/* point to a structure that points back to the perl structure and stuff */
OPT(INTERFACE, config.c_ip_addr);
}
/* point to a structure that points back to the perl structure and stuff */
OPT(URL, IO->ConnectMe->PlainUrl);
if (StrLength(IO->ConnectMe->CurlCreds))
{
OPT(URL, IO->ConnectMe->PlainUrl);
if (StrLength(IO->ConnectMe->CurlCreds))
{
- CtdlLogPrintf(CTDL_ERR, "EVCURL: error attaching to curl multi handle: %s\n", curl_multi_strerror(msta));
+ syslog(LOG_ERR, "EVCURL: error attaching to curl multi handle: %s\n", curl_multi_strerror(msta));
IO->HttpReq.attached = 1;
ev_async_send (event_base, &WakeupCurl);
}
static void WakeupCurlCallback(EV_P_ ev_async *w, int revents)
{
IO->HttpReq.attached = 1;
ev_async_send (event_base, &WakeupCurl);
}
static void WakeupCurlCallback(EV_P_ ev_async *w, int revents)
{
citthread_mutex_init(&EventQueueMutex, NULL);
if (pipe(event_add_pipe) != 0) {
citthread_mutex_init(&EventQueueMutex, NULL);
if (pipe(event_add_pipe) != 0) {
CtdlFillSystemContext(&libev_client_CC, "LibEv Thread");
// citthread_setspecific(MyConKey, (void *)&smtp_queue_CC);
CtdlFillSystemContext(&libev_client_CC, "LibEv Thread");
// citthread_setspecific(MyConKey, (void *)&smtp_queue_CC);
citthread_mutex_init(&DBEventQueueMutex, NULL);
if (pipe(evdb_add_pipe) != 0) {
citthread_mutex_init(&DBEventQueueMutex, NULL);
if (pipe(evdb_add_pipe) != 0) {
CtdlFillSystemContext(&libev_msg_CC, "LibEv DB IO Thread");
// citthread_setspecific(MyConKey, (void *)&smtp_queue_CC);
CtdlFillSystemContext(&libev_msg_CC, "LibEv DB IO Thread");
// citthread_setspecific(MyConKey, (void *)&smtp_queue_CC);