mirror of
https://github.com/libevent/libevent.git
synced 2025-01-31 09:12:55 +08:00
Define evhttp_del_accept_socket
[Patch from David Reiss] svn:r1423
This commit is contained in:
parent
6c53334c65
commit
c8b0fe4ad7
8
http.c
8
http.c
@ -2462,6 +2462,14 @@ evutil_socket_t evhttp_bound_socket_get_fd(struct evhttp_bound_socket *bound)
|
||||
return bound->bind_ev.ev_fd;
|
||||
}
|
||||
|
||||
void
|
||||
evhttp_del_accept_socket(struct evhttp *http, struct evhttp_bound_socket *bound)
|
||||
{
|
||||
TAILQ_REMOVE(&http->sockets, bound, next);
|
||||
event_del(&bound->bind_ev);
|
||||
mm_free(bound);
|
||||
}
|
||||
|
||||
static struct evhttp*
|
||||
evhttp_new_object(void)
|
||||
{
|
||||
|
@ -137,6 +137,22 @@ int evhttp_accept_socket(struct evhttp *http, evutil_socket_t fd);
|
||||
*/
|
||||
struct evhttp_bound_socket *evhttp_accept_socket_with_handle(struct evhttp *http, evutil_socket_t fd);
|
||||
|
||||
/**
|
||||
* Makes an HTTP server stop accepting connections on the specified socket
|
||||
*
|
||||
* This may be useful when a socket has been sent via file descriptor passing
|
||||
* and is no longer needed by the current process.
|
||||
*
|
||||
* This function does not close the socket.
|
||||
*
|
||||
* \a bound_socket is an invalid pointer after this call returns.
|
||||
*
|
||||
* @param http a pointer to an evhttp object
|
||||
* @param bound_socket a handle returned by evhttp_{bind,accept}_socket_with_handle
|
||||
* @see evhttp_bind_socket_with_handle(), evhttp_accept_socket_with_handle()
|
||||
*/
|
||||
void evhttp_del_accept_socket(struct evhttp *http, struct evhttp_bound_socket *bound_socket);
|
||||
|
||||
/**
|
||||
* Get the raw file descriptor referenced by an evhttp_bound_socket.
|
||||
*
|
||||
|
Loading…
x
Reference in New Issue
Block a user