}
if (n == 0) {
- event_warnx("%s: write nothing\n", __func__);
+ event_warnx("%s: write nothing", __func__);
evhttp_connection_fail(evcon, EVCON_HTTP_EOF);
return;
}
socklen_t errsz = sizeof(error);
if (what == EV_TIMEOUT) {
- event_warnx("%s: connection timeout for \"%s:%d\" on %d\n",
+ event_warnx("%s: connection timeout for \"%s:%d\" on %d",
__func__, evcon->address, evcon->port, evcon->fd);
goto cleanup;
}
}
if (error) {
- event_warnx("%s: connect failed for \"%s:%d\" on %d: %s\n",
+ event_warnx("%s: connect failed for \"%s:%d\" on %d: %s",
__func__, evcon->address, evcon->port, evcon->fd,
strerror(error));
goto cleanup;
req->major = 1;
req->minor = 1;
} else {
- event_warnx("%s: bad protocol \"%s\"\n",
+ event_warnx("%s: bad protocol \"%s\"",
__func__, protocol);
return (-1);
}
req->response_code = atoi(number);
if (!evhttp_valid_response_code(req->response_code)) {
- event_warnx("%s: bad response code \"%s\"\n",
+ event_warnx("%s: bad response code \"%s\"",
__func__, number);
return (-1);
}
} else if (strcmp(method, "HEAD") == 0) {
req->type = EVHTTP_REQ_HEAD;
} else {
- event_warnx("%s: bad method %s on request %p\n",
- __func__, method, req);
+ event_warnx("%s: bad method %s on request %p from %s",
+ __func__, method, req, req->remote_host);
return (-1);
}
req->major = 1;
req->minor = 1;
} else {
- event_warnx("%s: bad version %s on request %p\n",
- __func__, version, req);
+ event_warnx("%s: bad version %s on request %p from %s",
+ __func__, version, req, req->remote_host);
return (-1);
}
strcasecmp(connection, "Close") != 0) {
/* Bad combination, we don't know when it will end */
event_warnx("%s: we got no content length, but the "
- "server wants to keep the connection open: %s.\n",
+ "server wants to keep the connection open: %s.",
__func__, connection);
return (-1);
} else if (content_length == NULL) {
n = evbuffer_read(evcon->input_buffer, fd, -1);
if (n == 0) {
- event_warnx("%s: no more data on %d\n", __func__, fd);
+ event_warnx("%s: no more data on %d", __func__, fd);
evhttp_connection_fail(evcon, EVCON_HTTP_EOF);
return;
}
if (n == -1) {
- event_warnx("%s: bad read on %d\n", __func__, fd);
+ event_warnx("%s: bad read on %d", __func__, fd);
evhttp_connection_fail(evcon, EVCON_HTTP_EOF);
return;
}
break;
default:
- event_warnx("%s: bad header on %d\n", __func__, fd);
+ event_warnx("%s: bad header on %d", __func__, fd);
evhttp_connection_fail(evcon, EVCON_HTTP_INVALID_HEADER);
break;
}