From 38412ad5783e22834c01b5fdbbc8baca34dbdcb1 Mon Sep 17 00:00:00 2001 From: David Flatz Date: Fri, 12 Sep 2025 08:32:32 +0200 Subject: Reenable connection reuse since performance hit is too big; expose option to force a fresh connection instead so that affected forking scripts can work around the problem that open connections from parent get closed by exiting children --- it_url.class | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/it_url.class b/it_url.class index 26390eb..50d7152 100644 --- a/it_url.class +++ b/it_url.class @@ -264,7 +264,7 @@ static function curl_opts($p=array()) $add += [CURLOPT_ENCODING => $p['accept_encoding']]; # NOTE: the curl library renamed the option to CURLOPT_ACCEPT_ENCODING, in php both are possible, CURLOPT_ENCODING is documented return $add + [ - CURLOPT_FORBID_REUSE => true, + CURLOPT_FRESH_CONNECT => $p['fresh_con'] ? true : false, CURLOPT_HEADER => false, CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT_MS => $p['totaltimeout'] * 1000, # use _MS to support fractions of seconds @@ -290,6 +290,7 @@ static function curl_opts($p=array()) * @param $p['data'] POST data array with key-value pairs * @param $p['files'] [fieldname => filename] of files to upload * @param $p['method'] different HTTP method + * @param $p['fresh_con'] force a fresh connection instead of a cached one * @param $p['verbose'] generate and capture curl verbose output in $this->verbose and alert mails */ -- cgit v1.2.3