mirror of
https://github.com/libevent/libevent.git
synced 2025-01-31 09:12:55 +08:00
Make it compile under gcc --std=c89.
This commit is contained in:
parent
ff3f6cd42b
commit
e2ca403fae
@ -100,7 +100,7 @@ evbuffer_commit_read(struct evbuffer *evbuf, ev_ssize_t nBytes)
|
|||||||
|
|
||||||
EVBUFFER_LOCK(evbuf);
|
EVBUFFER_LOCK(evbuf);
|
||||||
EVUTIL_ASSERT(buf->read_in_progress && !buf->write_in_progress);
|
EVUTIL_ASSERT(buf->read_in_progress && !buf->write_in_progress);
|
||||||
EVUTIL_ASSERT(nBytes >= 0); // XXXX Can this be false?
|
EVUTIL_ASSERT(nBytes >= 0); /* XXXX Can this be false? */
|
||||||
|
|
||||||
evbuffer_unfreeze(evbuf, 0);
|
evbuffer_unfreeze(evbuf, 0);
|
||||||
|
|
||||||
|
4
evdns.c
4
evdns.c
@ -2850,7 +2850,7 @@ int evdns_resolve_reverse_ipv6(const struct in6_addr *in, int flags, evdns_callb
|
|||||||
? 0 : -1;
|
? 0 : -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*/////////////////////////////////////////////////////////////////// */
|
/* ================================================================= */
|
||||||
/* Search support */
|
/* Search support */
|
||||||
/* */
|
/* */
|
||||||
/* the libc resolver has support for searching a number of domains */
|
/* the libc resolver has support for searching a number of domains */
|
||||||
@ -3121,7 +3121,7 @@ search_request_finished(struct evdns_request *const req) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*/////////////////////////////////////////////////////////////////// */
|
/* ================================================================= */
|
||||||
/* Parsing resolv.conf files */
|
/* Parsing resolv.conf files */
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -67,7 +67,6 @@ regress_pick_a_port(void *arg)
|
|||||||
struct basic_test_data *data = arg;
|
struct basic_test_data *data = arg;
|
||||||
struct event_base *base = data->base;
|
struct event_base *base = data->base;
|
||||||
struct evconnlistener *listener1 = NULL, *listener2 = NULL;
|
struct evconnlistener *listener1 = NULL, *listener2 = NULL;
|
||||||
//struct event *connecting;
|
|
||||||
struct sockaddr_in sin;
|
struct sockaddr_in sin;
|
||||||
int count1 = 2, count2 = 1;
|
int count1 = 2, count2 = 1;
|
||||||
struct sockaddr_storage ss1, ss2;
|
struct sockaddr_storage ss1, ss2;
|
||||||
|
@ -77,7 +77,6 @@ loud_writecb(struct bufferevent *bev, void *ctx)
|
|||||||
while (evbuffer_get_length(output) < 8192) {
|
while (evbuffer_get_length(output) < 8192) {
|
||||||
evbuffer_add(output, buf, sizeof(buf));
|
evbuffer_add(output, buf, sizeof(buf));
|
||||||
cs->queued += sizeof(buf);
|
cs->queued += sizeof(buf);
|
||||||
// printf("queued %d\n", (int)sizeof(buf));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -89,7 +88,6 @@ discard_readcb(struct bufferevent *bev, void *ctx)
|
|||||||
size_t len = evbuffer_get_length(input);
|
size_t len = evbuffer_get_length(input);
|
||||||
evbuffer_drain(input, len);
|
evbuffer_drain(input, len);
|
||||||
cs->received += len;
|
cs->received += len;
|
||||||
// printf("read %d bytes\n", (int)len);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -108,9 +106,7 @@ echo_readcb(struct bufferevent *bev, void *ctx)
|
|||||||
struct evbuffer *input = bufferevent_get_input(bev);
|
struct evbuffer *input = bufferevent_get_input(bev);
|
||||||
struct evbuffer *output = bufferevent_get_output(bev);
|
struct evbuffer *output = bufferevent_get_output(bev);
|
||||||
|
|
||||||
// puts("read.");
|
|
||||||
evbuffer_add_buffer(output, input);
|
evbuffer_add_buffer(output, input);
|
||||||
// printf(" outbuf len is now %d\n", (int)evbuffer_get_length(output));
|
|
||||||
if (evbuffer_get_length(output) > 1024000)
|
if (evbuffer_get_length(output) > 1024000)
|
||||||
bufferevent_disable(bev, EV_READ);
|
bufferevent_disable(bev, EV_READ);
|
||||||
}
|
}
|
||||||
@ -191,7 +187,6 @@ test_ratelimiting(void)
|
|||||||
states = calloc(cfg_n_connections, sizeof(struct client_state));
|
states = calloc(cfg_n_connections, sizeof(struct client_state));
|
||||||
|
|
||||||
for (i = 0; i < cfg_n_connections; ++i) {
|
for (i = 0; i < cfg_n_connections; ++i) {
|
||||||
// printf("creating %d:\n",i);
|
|
||||||
bevs[i] = bufferevent_socket_new(base, -1,
|
bevs[i] = bufferevent_socket_new(base, -1,
|
||||||
BEV_OPT_CLOSE_ON_FREE|BEV_OPT_THREADSAFE);
|
BEV_OPT_CLOSE_ON_FREE|BEV_OPT_THREADSAFE);
|
||||||
assert(bevs[i]);
|
assert(bevs[i]);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user