Skip to content

Commit 446a2a8

Browse files
committed
Make references to handle local
1 parent 38fcf8f commit 446a2a8

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

http.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -778,6 +778,7 @@ Datum http_set_curlopt(PG_FUNCTION_ARGS)
778778
int i = 0;
779779
char *curlopt, *value;
780780
text *curlopt_txt, *value_txt;
781+
CURL *handle;
781782

782783
/* Version check */
783784
http_check_curl_version(curl_version_info(CURLVERSION_NOW));
@@ -787,7 +788,7 @@ Datum http_set_curlopt(PG_FUNCTION_ARGS)
787788
PG_RETURN_BOOL(false);
788789

789790
/* Set up global HTTP handle */
790-
g_http_handle = http_get_handle();
791+
handle = http_get_handle();
791792

792793
/* Read arguments */
793794
curlopt_txt = PG_GETARG_TEXT_P(0);
@@ -803,7 +804,7 @@ Datum http_set_curlopt(PG_FUNCTION_ARGS)
803804
{
804805
if (opt->curlopt_val) pfree(opt->curlopt_val);
805806
opt->curlopt_val = MemoryContextStrdup(CacheMemoryContext, value);
806-
PG_RETURN_BOOL(set_curlopt(g_http_handle, opt));
807+
PG_RETURN_BOOL(set_curlopt(handle, opt));
807808
}
808809
}
809810

0 commit comments

Comments
 (0)