From 446a2a8ab159ade01b9f963ebc5c84a2f21f4eb1 Mon Sep 17 00:00:00 2001 From: Paul Ramsey Date: Fri, 6 Jul 2018 14:25:33 -0700 Subject: [PATCH] Make references to handle local --- http.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/http.c b/http.c index ec99320..aaa18a1 100644 --- a/http.c +++ b/http.c @@ -778,6 +778,7 @@ Datum http_set_curlopt(PG_FUNCTION_ARGS) int i = 0; char *curlopt, *value; text *curlopt_txt, *value_txt; + CURL *handle; /* Version check */ http_check_curl_version(curl_version_info(CURLVERSION_NOW)); @@ -787,7 +788,7 @@ Datum http_set_curlopt(PG_FUNCTION_ARGS) PG_RETURN_BOOL(false); /* Set up global HTTP handle */ - g_http_handle = http_get_handle(); + handle = http_get_handle(); /* Read arguments */ curlopt_txt = PG_GETARG_TEXT_P(0); @@ -803,7 +804,7 @@ Datum http_set_curlopt(PG_FUNCTION_ARGS) { if (opt->curlopt_val) pfree(opt->curlopt_val); opt->curlopt_val = MemoryContextStrdup(CacheMemoryContext, value); - PG_RETURN_BOOL(set_curlopt(g_http_handle, opt)); + PG_RETURN_BOOL(set_curlopt(handle, opt)); } }