From 98b608f2dcceabeada105d037b454987302170c5 Mon Sep 17 00:00:00 2001 From: Paul Ramsey Date: Fri, 6 Dec 2024 09:58:36 -0800 Subject: [PATCH] add backwards compat on old GUC names --- http.c | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/http.c b/http.c index 68626c9..0b8c811 100644 --- a/http.c +++ b/http.c @@ -363,6 +363,40 @@ http_guc_init_opt(http_curlopt *opt) pfree(opt_name_lower); pfree(opt_name); pfree(opt_url); + + /* + * Backwards compatibility, retain the old GUC + * http.keepalive name for now. + */ + if (opt->curlopt == CURLOPT_TCP_KEEPALIVE) + { + DefineCustomStringVariable( + "http.keepalive", + guc_strdup(ERROR, "https://curl.se/libcurl/c/CURLOPT_TCP_KEEPALIVE.html"), + NULL, + &(opt->curlopt_val), + NULL, + opt->superuser_only ? PGC_SUSET : PGC_USERSET, + 0, NULL, NULL, NULL + ); + } + + /* + * Backwards compatibility, retain the old GUC + * http.timeout_msec name for now. + */ + if (opt->curlopt == CURLOPT_TIMEOUT_MS) + { + DefineCustomStringVariable( + "http.timeout_msec", + guc_strdup(ERROR, "https://curl.se/libcurl/c/CURLOPT_TIMEOUT_MS.html"), + NULL, + &(opt->curlopt_val), + NULL, + opt->superuser_only ? PGC_SUSET : PGC_USERSET, + 0, NULL, NULL, NULL + ); + } } static void