mirror of
https://github.com/cuberite/libevent.git
synced 2025-09-10 04:50:37 -04:00
Merge remote branch 'origin/patches-2.0'
This commit is contained in:
commit
8f5cca47dd
4
evport.c
4
evport.c
@ -337,10 +337,14 @@ evport_dispatch(struct event_base *base, struct timeval *tv)
|
|||||||
* (because we have to pass this to the callback)
|
* (because we have to pass this to the callback)
|
||||||
*/
|
*/
|
||||||
res = 0;
|
res = 0;
|
||||||
|
if (pevt->portev_events & (POLLERR|POLLHUP)) {
|
||||||
|
res = EV_READ | EV_WRITE;
|
||||||
|
} else {
|
||||||
if (pevt->portev_events & POLLIN)
|
if (pevt->portev_events & POLLIN)
|
||||||
res |= EV_READ;
|
res |= EV_READ;
|
||||||
if (pevt->portev_events & POLLOUT)
|
if (pevt->portev_events & POLLOUT)
|
||||||
res |= EV_WRITE;
|
res |= EV_WRITE;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Check for the error situations or a hangup situation
|
* Check for the error situations or a hangup situation
|
||||||
|
4
http.c
4
http.c
@ -949,7 +949,9 @@ evhttp_read_body(struct evhttp_connection *evcon, struct evhttp_request *req)
|
|||||||
evbuffer_remove_buffer(buf, req->input_buffer, n);
|
evbuffer_remove_buffer(buf, req->input_buffer, n);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (req->body_size > req->evcon->max_body_size) {
|
if (req->body_size > req->evcon->max_body_size ||
|
||||||
|
(!req->chunked && req->ntoread >= 0 &&
|
||||||
|
(size_t)req->ntoread > req->evcon->max_body_size)) {
|
||||||
/* failed body length test */
|
/* failed body length test */
|
||||||
event_debug(("Request body is too long"));
|
event_debug(("Request body is too long"));
|
||||||
evhttp_connection_fail(evcon,
|
evhttp_connection_fail(evcon,
|
||||||
|
@ -748,8 +748,9 @@ const struct timeval *event_base_init_common_timeout(struct event_base *base,
|
|||||||
|
|
||||||
Note that all memory returned from Libevent will be allocated by the
|
Note that all memory returned from Libevent will be allocated by the
|
||||||
replacement functions rather than by malloc() and realloc(). Thus, if you
|
replacement functions rather than by malloc() and realloc(). Thus, if you
|
||||||
have replaced those functions, it may not be appropriate to free() memory
|
have replaced those functions, it will not be appropriate to free() memory
|
||||||
that you get from Libevent.
|
that you get from Libevent. Instead, you must use the free_fn replacement
|
||||||
|
that you provided.
|
||||||
|
|
||||||
@param malloc_fn A replacement for malloc.
|
@param malloc_fn A replacement for malloc.
|
||||||
@param realloc_fn A replacement for realloc
|
@param realloc_fn A replacement for realloc
|
||||||
|
@ -154,7 +154,10 @@ struct evconnlistener *evhttp_bound_socket_get_listener(struct evhttp_bound_sock
|
|||||||
* This may be useful when a socket has been sent via file descriptor passing
|
* This may be useful when a socket has been sent via file descriptor passing
|
||||||
* and is no longer needed by the current process.
|
* and is no longer needed by the current process.
|
||||||
*
|
*
|
||||||
* This function does not close the socket.
|
* If you created this bound socket with evhttp_bind_socket_with_handle or
|
||||||
|
* evhttp_accept_socket_with_handle, this function closes the fd you provided.
|
||||||
|
* If you created this bound socket with evhttp_bind_listener, this function
|
||||||
|
* frees the listener you provided.
|
||||||
*
|
*
|
||||||
* \a bound_socket is an invalid pointer after this call returns.
|
* \a bound_socket is an invalid pointer after this call returns.
|
||||||
*
|
*
|
||||||
|
@ -75,7 +75,7 @@ What's New In Libevent 2.0 so far:
|
|||||||
evutil.h) will continue to work by including the corresponding new
|
evutil.h) will continue to work by including the corresponding new
|
||||||
headers. Old code should not be broken by this change.
|
headers. Old code should not be broken by this change.
|
||||||
|
|
||||||
2.2. New thread-safe, binary-compatibile, harder-to-mess-up APIs
|
2.2. New thread-safe, binary-compatible, harder-to-mess-up APIs
|
||||||
|
|
||||||
Some aspects of the historical Libevent API have encouraged
|
Some aspects of the historical Libevent API have encouraged
|
||||||
non-threadsafe code, or forced code built against one version of Libevent
|
non-threadsafe code, or forced code built against one version of Libevent
|
||||||
|
Loading…
x
Reference in New Issue
Block a user