}
}
-static void http_client_global_context_free(void)
+void http_client_global_context_free(void)
{
+ if (http_client_global_context == NULL)
+ return;
+
/* Drop ioloop switch callback to make absolutely sure there is no
recursion. */
io_loop_remove_switch_callback(
returned context. */
struct http_client_context *http_client_get_global_context(void);
+/* Explicitly free the global context. This function is only useful for testing:
+ the global context is cleaned up implicitly. */
+void http_client_global_context_free(void);
+
#endif