This removes the possibility of recursion when the client context object somehow
triggers an ioloop switch (e.g., when debug logging starts blocking at that
inopportune moment).
http_client_context_do_switch_ioloop(cctx);
}
-static void http_client_global_context_free(void)
-{
- http_client_context_unref(&http_client_global_context);
-}
-
static void
http_client_global_context_ioloop_switched(
struct ioloop *prev_ioloop ATTR_UNUSED)
}
}
+static void http_client_global_context_free(void)
+{
+ /* drop ioloop switch callback to make absolutely sure there is no
+ recursion. */
+ io_loop_remove_switch_callback(http_client_global_context_ioloop_switched);
+
+ http_client_context_unref(&http_client_global_context);
+}
+
struct http_client_context *http_client_get_global_context(void)
{
if (http_client_global_context != NULL)