Merge remote-tracking branch 'github/20_win64_compilation' into 21_win64_compilation

Conflicts:
	http.c
	signal.c
This commit is contained in:
Nick Mathewson 2012-11-02 11:46:14 -04:00
commit f9182d7249
3 changed files with 28 additions and 19 deletions

41
http.c
View File

@ -1323,9 +1323,10 @@ evhttp_error_cb(struct bufferevent *bufev, short what, void *arg)
switch (evcon->state) { switch (evcon->state) {
case EVCON_CONNECTING: case EVCON_CONNECTING:
if (what & BEV_EVENT_TIMEOUT) { if (what & BEV_EVENT_TIMEOUT) {
event_debug(("%s: connection timeout for \"%s:%d\" on %d", event_debug(("%s: connection timeout for \"%s:%d\" on "
EV_SOCK_FMT,
__func__, evcon->address, evcon->port, __func__, evcon->address, evcon->port,
evcon->fd)); EV_SOCK_ARG(evcon->fd)));
evhttp_connection_cb_cleanup(evcon); evhttp_connection_cb_cleanup(evcon);
return; return;
} }
@ -1401,21 +1402,25 @@ evhttp_connection_cb(struct bufferevent *bufev, short what, void *arg)
/* Check if the connection completed */ /* Check if the connection completed */
if (getsockopt(evcon->fd, SOL_SOCKET, SO_ERROR, (void*)&error, if (getsockopt(evcon->fd, SOL_SOCKET, SO_ERROR, (void*)&error,
&errsz) == -1) { &errsz) == -1) {
event_debug(("%s: getsockopt for \"%s:%d\" on %d", event_debug(("%s: getsockopt for \"%s:%d\" on "EV_SOCK_FMT,
__func__, evcon->address, evcon->port, evcon->fd)); __func__, evcon->address, evcon->port,
EV_SOCK_ARG(evcon->fd)));
goto cleanup; goto cleanup;
} }
if (error) { if (error) {
event_debug(("%s: connect failed for \"%s:%d\" on %d: %s", event_debug(("%s: connect failed for \"%s:%d\" on "
__func__, evcon->address, evcon->port, evcon->fd, EV_SOCK_FMT": %s",
__func__, evcon->address, evcon->port,
EV_SOCK_ARG(evcon->fd),
evutil_socket_error_to_string(error))); evutil_socket_error_to_string(error)));
goto cleanup; goto cleanup;
} }
/* We are connected to the server now */ /* We are connected to the server now */
event_debug(("%s: connected to \"%s:%d\" on %d\n", event_debug(("%s: connected to \"%s:%d\" on "EV_SOCK_FMT"\n",
__func__, evcon->address, evcon->port, evcon->fd)); __func__, evcon->address, evcon->port,
EV_SOCK_ARG(evcon->fd)));
/* Reset the retry count as we were successful in connecting */ /* Reset the retry count as we were successful in connecting */
evcon->retry_cnt = 0; evcon->retry_cnt = 0;
@ -2062,8 +2067,8 @@ evhttp_read_firstline(struct evhttp_connection *evcon,
res = evhttp_parse_firstline_(req, bufferevent_get_input(evcon->bufev)); res = evhttp_parse_firstline_(req, bufferevent_get_input(evcon->bufev));
if (res == DATA_CORRUPTED || res == DATA_TOO_LONG) { if (res == DATA_CORRUPTED || res == DATA_TOO_LONG) {
/* Error while reading, terminate */ /* Error while reading, terminate */
event_debug(("%s: bad header lines on %d\n", event_debug(("%s: bad header lines on "EV_SOCK_FMT"\n",
__func__, evcon->fd)); __func__, EV_SOCK_ARG(evcon->fd)));
evhttp_connection_fail_(evcon, EVCON_HTTP_INVALID_HEADER); evhttp_connection_fail_(evcon, EVCON_HTTP_INVALID_HEADER);
return; return;
} else if (res == MORE_DATA_EXPECTED) { } else if (res == MORE_DATA_EXPECTED) {
@ -2085,7 +2090,8 @@ evhttp_read_header(struct evhttp_connection *evcon,
res = evhttp_parse_headers_(req, bufferevent_get_input(evcon->bufev)); res = evhttp_parse_headers_(req, bufferevent_get_input(evcon->bufev));
if (res == DATA_CORRUPTED || res == DATA_TOO_LONG) { if (res == DATA_CORRUPTED || res == DATA_TOO_LONG) {
/* Error while reading, terminate */ /* Error while reading, terminate */
event_debug(("%s: bad header lines on %d\n", __func__, fd)); event_debug(("%s: bad header lines on "EV_SOCK_FMT"\n",
__func__, EV_SOCK_ARG(fd)));
evhttp_connection_fail_(evcon, EVCON_HTTP_INVALID_HEADER); evhttp_connection_fail_(evcon, EVCON_HTTP_INVALID_HEADER);
return; return;
} else if (res == MORE_DATA_EXPECTED) { } else if (res == MORE_DATA_EXPECTED) {
@ -2099,8 +2105,8 @@ evhttp_read_header(struct evhttp_connection *evcon,
/* Done reading headers, do the real work */ /* Done reading headers, do the real work */
switch (req->kind) { switch (req->kind) {
case EVHTTP_REQUEST: case EVHTTP_REQUEST:
event_debug(("%s: checking for post data on %d\n", event_debug(("%s: checking for post data on "EV_SOCK_FMT"\n",
__func__, fd)); __func__, EV_SOCK_ARG(fd)));
evhttp_get_body(evcon, req); evhttp_get_body(evcon, req);
/* note the request may have been freed in evhttp_get_body */ /* note the request may have been freed in evhttp_get_body */
break; break;
@ -2116,8 +2122,9 @@ evhttp_read_header(struct evhttp_connection *evcon,
__func__, req->response_code)); __func__, req->response_code));
evhttp_connection_done(evcon); evhttp_connection_done(evcon);
} else { } else {
event_debug(("%s: start of read body for %s on %d\n", event_debug(("%s: start of read body for %s on "
__func__, req->remote_host, fd)); EV_SOCK_FMT"\n",
__func__, req->remote_host, EV_SOCK_ARG(fd)));
evhttp_get_body(evcon, req); evhttp_get_body(evcon, req);
/* note the request may have been freed in /* note the request may have been freed in
* evhttp_get_body */ * evhttp_get_body */
@ -3844,8 +3851,8 @@ evhttp_get_request_connection(
return (NULL); return (NULL);
} }
event_debug(("%s: new request from %s:%s on %d\n", event_debug(("%s: new request from %s:%s on "EV_SOCK_FMT"\n",
__func__, hostname, portname, fd)); __func__, hostname, portname, EV_SOCK_ARG(fd)));
/* we need a connection object to put the http request on */ /* we need a connection object to put the http request on */
if (http->bevcb != NULL) { if (http->bevcb != NULL) {

View File

@ -362,7 +362,8 @@ evsig_del(struct event_base *base, evutil_socket_t evsignal, short old, short ev
{ {
EVUTIL_ASSERT(evsignal >= 0 && evsignal < NSIG); EVUTIL_ASSERT(evsignal >= 0 && evsignal < NSIG);
event_debug(("%s: "EV_SOCK_FMT": restoring signal handler", __func__, EV_SOCK_ARG(evsignal))); event_debug(("%s: "EV_SOCK_FMT": restoring signal handler",
__func__, EV_SOCK_ARG(evsignal)));
EVSIGBASE_LOCK(); EVSIGBASE_LOCK();
--evsig_base_n_signals_added; --evsig_base_n_signals_added;

View File

@ -248,7 +248,8 @@ win32_del(struct event_base *base, evutil_socket_t fd, short old, short events,
struct win32op *win32op = base->evbase; struct win32op *win32op = base->evbase;
struct idx_info *idx = idx_; struct idx_info *idx = idx_;
event_debug(("%s: Removing event for %d", __func__, fd)); event_debug(("%s: Removing event for "EV_SOCK_FMT,
__func__, EV_SOCK_ARG(fd)));
if (events & EV_READ) if (events & EV_READ)
do_fd_clear(base, win32op, idx, 1); do_fd_clear(base, win32op, idx, 1);
if (events & EV_WRITE) if (events & EV_WRITE)