atomic_store(&listener->h2.max_concurrent_streams, max_streams);
}
+typedef struct http_endpoints_data {
+ isc_nmsocket_t *listener;
+ isc_nm_http_endpoints_t *endpoints;
+} http_endpoints_data_t;
+
+static void
+http_set_endpoints_cb(void *arg) {
+ http_endpoints_data_t *data = arg;
+ const int tid = isc_tid();
+ isc_nmsocket_t *listener = data->listener;
+ isc_nm_http_endpoints_t *endpoints = data->endpoints;
+ isc__networker_t *worker = &listener->worker->netmgr->workers[tid];
+
+ isc_mem_put(worker->loop->mctx, data, sizeof(*data));
+
+ isc_nm_http_endpoints_detach(&listener->h2.listener_endpoints[tid]);
+ isc_nm_http_endpoints_attach(endpoints,
+ &listener->h2.listener_endpoints[tid]);
+
+ isc_nm_http_endpoints_detach(&endpoints);
+ isc__nmsocket_detach(&listener);
+}
+
void
isc_nm_http_set_endpoints(isc_nmsocket_t *listener,
isc_nm_http_endpoints_t *eps) {
atomic_store(&eps->in_use, true);
for (size_t i = 0; i < isc_loopmgr_nloops(loopmgr); i++) {
- isc__netievent__http_eps_t *ievent =
- isc__nm_get_netievent_httpendpoints(
- &listener->worker->netmgr->workers[i], listener,
- eps);
- isc__nm_enqueue_ievent(&listener->worker->netmgr->workers[i],
- (isc__netievent_t *)ievent);
- }
-}
+ isc__networker_t *worker =
+ &listener->worker->netmgr->workers[i];
+ http_endpoints_data_t *data = isc_mem_getx(
+ worker->loop->mctx, sizeof(*data), ISC_MEM_ZERO);
-void
-isc__nm_async_httpendpoints(isc__networker_t *worker, isc__netievent_t *ev0) {
- isc__netievent__http_eps_t *ievent = (isc__netievent__http_eps_t *)ev0;
- const int tid = isc_tid();
- isc_nmsocket_t *listener = ievent->sock;
- isc_nm_http_endpoints_t *eps = ievent->endpoints;
+ isc__nmsocket_attach(listener, &data->listener);
+ isc_nm_http_endpoints_attach(eps, &data->endpoints);
- UNUSED(worker);
-
- isc_nm_http_endpoints_detach(&listener->h2.listener_endpoints[tid]);
- isc_nm_http_endpoints_attach(eps,
- &listener->h2.listener_endpoints[tid]);
+ isc_async_run(worker->loop, http_set_endpoints_cb, data);
+ }
}
static void
};
typedef enum isc__netievent_type {
- netievent_httpendpoints,
-
netievent_streamdnsread,
netievent_streamdnscancel,
const char *
isc__nm_http_verify_tls_peer_result_string(const isc_nmhandle_t *handle);
-void
-isc__nm_async_httpendpoints(isc__networker_t *worker, isc__netievent_t *ev0);
-
bool
isc__nm_parse_httpquery(const char *query_string, const char **start,
size_t *len);
* typedef all the netievent types
*/
-#ifdef HAVE_LIBNGHTTP2
-NETIEVENT_SOCKET_HTTP_EPS_TYPE(httpendpoints);
-#endif /* HAVE_LIBNGHTTP2 */
-
NETIEVENT_SOCKET_REQ_RESULT_TYPE(sendcb);
NETIEVENT_SOCKET_TYPE(streamdnsread);
/* Now declared the helper functions */
-#ifdef HAVE_LIBNGHTTP2
-NETIEVENT_SOCKET_HTTP_EPS_DECL(httpendpoints);
-#endif /* HAVE_LIBNGHTTP2 */
-
NETIEVENT_SOCKET_REQ_RESULT_DECL(sendcb);
NETIEVENT_SOCKET_DECL(streamdnsread);