Declare the previously private struct evhttp_bound_socket in
event2/http.h as an opaque struct.
Implement evhttp_bound_socket_get_fd, which returns the file descriptor
of an evhttp_bound_socket.
[Patch from David Reiss]
svn:r1421
return (0);
}
+evutil_socket_t evhttp_bound_socket_get_fd(struct evhttp_bound_socket *bound)
+{
+ return bound->bind_ev.ev_fd;
+}
+
static struct evhttp*
evhttp_new_object(void)
{
struct evhttp;
struct evhttp_request;
struct evkeyvalq;
+struct evhttp_bound_socket;
/**
* Create a new HTTP server.
*/
int evhttp_accept_socket(struct evhttp *http, evutil_socket_t fd);
+/**
+ * Get the raw file descriptor referenced by an evhttp_bound_socket.
+ *
+ * @param bound_socket a handle returned by evhttp_{bind,accept}_socket_with_handle
+ * @return the file descriptor used by the bound socket
+ * @see evhttp_bind_socket_with_handle(), evhttp_accept_socket_with_handle()
+ */
+evutil_socket_t evhttp_bound_socket_get_fd(struct evhttp_bound_socket *bound_socket);
+
/**
* Free the previously created HTTP server.
*