{
enum message_read_status res;
- 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) {
/* Error while reading, terminate */
- event_debug(("%s: bad header lines on %d\n",
- __func__, evcon->fd));
+ event_debug(("%s: bad header lines on "EV_SOCK_FMT"\n",
+ __func__, EV_SOCK_ARG(evcon->fd)));
- evhttp_connection_fail(evcon, EVCON_HTTP_INVALID_HEADER);
+ evhttp_connection_fail_(evcon, EVCON_HTTP_INVALID_HEADER);
return;
} else if (res == MORE_DATA_EXPECTED) {
/* Need more header lines */
enum message_read_status res;
evutil_socket_t fd = evcon->fd;
- 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) {
/* 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;
} else if (res == MORE_DATA_EXPECTED) {
/* Need more header lines */
return (NULL);
}
- event_debug(("%s: new request from %s:%s on %d\n",
- __func__, hostname, portname, fd));
+ event_debug(("%s: new request from %s:%s on "EV_SOCK_FMT"\n",
+ __func__, hostname, portname, EV_SOCK_ARG(fd)));
/* we need a connection object to put the http request on */
- evcon = evhttp_connection_base_new(
- http->base, NULL, hostname, atoi(portname));
+ if (http->bevcb != NULL) {
+ bev = (*http->bevcb)(http->base, http->bevcbarg);
+ }
+ evcon = evhttp_connection_base_bufferevent_new(
+ http->base, NULL, bev, hostname, atoi(portname));
mm_free(hostname);
mm_free(portname);
if (evcon == NULL)
int
win32_del(struct event_base *base, evutil_socket_t fd, short old, short events,
- void *_idx)
+ void *idx_)
{
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)
do_fd_clear(base, win32op, idx, 1);
if (events & EV_WRITE)