msg (M_WARN, "HTTP proxy support only works for TCP based connections");
return false;
}
- ho = init_http_proxy_options_once (ce->http_proxy_options, gc);
+ ho = init_http_proxy_options_once (&ce->http_proxy_options, gc);
ho->server = string_alloc (p[2], gc);
ho->port = port;
ho->retry = true;
ho->auth_retry = (p[4] && streq (p[4], "nct") ? PAR_NCT : PAR_ALL);
- ce->http_proxy_options = ho;
ret = true;
#endif
}
goto err;
}
- ho = init_http_proxy_options_once (options->ce.http_proxy_options, &options->gc);
+ ho = init_http_proxy_options_once (&options->ce.http_proxy_options, &options->gc);
ho->server = p[1];
ho->port = port;
{
struct http_proxy_options *ho;
VERIFY_PERMISSION (OPT_P_GENERAL|OPT_P_CONNECTION);
- ho = init_http_proxy_options_once (options->ce.http_proxy_options, &options->gc);
+ ho = init_http_proxy_options_once (&options->ce.http_proxy_options, &options->gc);
ho->retry = true;
}
else if (streq (p[0], "http-proxy-timeout") && p[1])
struct http_proxy_options *ho;
VERIFY_PERMISSION (OPT_P_GENERAL|OPT_P_CONNECTION);
- ho = init_http_proxy_options_once (options->ce.http_proxy_options, &options->gc);
+ ho = init_http_proxy_options_once (&options->ce.http_proxy_options, &options->gc);
ho->timeout = positive_atoi (p[1]);
}
else if (streq (p[0], "http-proxy-option") && p[1])
struct http_proxy_options *ho;
VERIFY_PERMISSION (OPT_P_GENERAL|OPT_P_CONNECTION);
- ho = init_http_proxy_options_once (options->ce.http_proxy_options, &options->gc);
+ ho = init_http_proxy_options_once (&options->ce.http_proxy_options, &options->gc);
if (streq (p[1], "VERSION") && p[2])
{
#define UP_TYPE_PROXY "HTTP Proxy"
struct http_proxy_options *
-init_http_proxy_options_once (struct http_proxy_options *hpo,
+init_http_proxy_options_once (struct http_proxy_options **hpo,
struct gc_arena *gc)
{
- if (!hpo)
+ if (!*hpo)
{
- ALLOC_OBJ_CLEAR_GC (hpo, struct http_proxy_options, gc);
+ ALLOC_OBJ_CLEAR_GC (*hpo, struct http_proxy_options, gc);
/* http proxy defaults */
- hpo->timeout = 5;
- hpo->http_version = "1.0";
+ (*hpo)->timeout = 5;
+ (*hpo)->http_version = "1.0";
}
- return hpo;
+ return *hpo;
}
bool queried_creds;
};
-struct http_proxy_options *init_http_proxy_options_once (struct http_proxy_options *hpo,
+struct http_proxy_options *init_http_proxy_options_once (struct http_proxy_options **hpo,
struct gc_arena *gc);
struct http_proxy_info *http_proxy_new (const struct http_proxy_options *o);