g_assert (error_handler != NULL && finish_handler != NULL);
+ if (ctx == NULL) {
+ ctx = rspamd_http_context_default ();
+ }
+
conn = g_malloc0 (sizeof (struct rspamd_http_connection));
conn->opts = opts;
conn->type = type;
conn->finished = FALSE;
/* Init priv */
- if (ctx == NULL) {
- ctx = rspamd_http_context_default ();
- }
-
priv = g_malloc0 (sizeof (struct rspamd_http_connection_private));
conn->priv = priv;
priv->ctx = ctx;
{
gint fd;
+ if (ctx == NULL) {
+ ctx = rspamd_http_context_default ();
+ }
+
if (ctx->http_proxies) {
struct upstream *up = rspamd_upstream_get (ctx->http_proxies,
RSPAMD_UPSTREAM_ROUND_ROBIN, NULL, 0);