#include <signal.h>
#include <string.h>
+#include <isc/async.h>
#include <isc/base64.h>
#include <isc/log.h>
#include <isc/netmgr.h>
}
}
+static void
+http_close_cb(void *arg) {
+ isc_nmsocket_t *sock = arg;
+ REQUIRE(VALID_NMSOCK(sock));
+
+ http_close_direct(sock);
+ isc__nmsocket_detach(&sock);
+}
+
void
isc__nm_http_close(isc_nmsocket_t *sock) {
bool destroy = false;
return;
}
- isc__netievent_httpclose_t *ievent =
- isc__nm_get_netievent_httpclose(sock->worker, sock);
-
- isc__nm_enqueue_ievent(sock->worker, (isc__netievent_t *)ievent);
-}
-
-void
-isc__nm_async_httpclose(isc__networker_t *worker, isc__netievent_t *ev0) {
- isc__netievent_httpclose_t *ievent = (isc__netievent_httpclose_t *)ev0;
- isc_nmsocket_t *sock = ievent->sock;
-
- REQUIRE(VALID_NMSOCK(sock));
- REQUIRE(sock->tid == isc_tid());
-
- UNUSED(worker);
-
- http_close_direct(sock);
+ isc__nmsocket_attach(sock, &(isc_nmsocket_t *){ NULL });
+ isc_async_run(sock->worker->loop, http_close_cb, sock);
}
static void
};
typedef enum isc__netievent_type {
- netievent_httpclose,
netievent_httpsend,
netievent_httpendpoints,
void
isc__nm_async_httpsend(isc__networker_t *worker, isc__netievent_t *ev0);
-void
-isc__nm_async_httpclose(isc__networker_t *worker, isc__netievent_t *ev0);
-
void
isc__nm_async_httpendpoints(isc__networker_t *worker, isc__netievent_t *ev0);
#ifdef HAVE_LIBNGHTTP2
NETIEVENT_SOCKET_REQ_TYPE(httpsend);
-NETIEVENT_SOCKET_TYPE(httpclose);
NETIEVENT_SOCKET_HTTP_EPS_TYPE(httpendpoints);
#endif /* HAVE_LIBNGHTTP2 */
#ifdef HAVE_LIBNGHTTP2
NETIEVENT_SOCKET_REQ_DECL(httpsend);
-NETIEVENT_SOCKET_DECL(httpclose);
NETIEVENT_SOCKET_HTTP_EPS_DECL(httpendpoints);
#endif /* HAVE_LIBNGHTTP2 */
switch (ievent->type) {
#if HAVE_LIBNGHTTP2
NETIEVENT_CASE(httpsend);
- NETIEVENT_CASE(httpclose);
NETIEVENT_CASE(httpendpoints);
#endif
NETIEVENT_CASE(streamdnsread);
#ifdef HAVE_LIBNGHTTP2
NETIEVENT_SOCKET_REQ_DEF(httpsend);
-NETIEVENT_SOCKET_DEF(httpclose);
NETIEVENT_SOCKET_HTTP_EPS_DEF(httpendpoints);
#endif /* HAVE_LIBNGHTTP2 */