Skip to content

Commit 9517db3

Browse files
committed
Remove invalid CURLOPT_MAXCONNECTS option and update timing details format in iOSCurlProgressCallback
1 parent 290940b commit 9517db3

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

example/iOS Test App/iOS Test App/ViewController.m

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ - (IBAction)Get:(id)sender
205205
curl_easy_setopt(_curl, CURLOPT_USERAGENT, curl_version()); // set a default user agent
206206
curl_easy_setopt(_curl, CURLOPT_VERBOSE, 1L); // turn on verbose
207207
curl_easy_setopt(_curl, CURLOPT_TIMEOUT, 60L); // seconds
208-
curl_easy_setopt(_curl, CURLOPT_MAXCONNECTS, 0L); // this should disallow connection sharing
208+
// curl_easy_setopt(_curl, CURLOPT_MAXCONNECTS, 0L); // REMOVED - 0 is invalid in curl 8.x
209209
curl_easy_setopt(_curl, CURLOPT_FORBID_REUSE, 1L); // enforce connection to be closed
210210
curl_easy_setopt(_curl, CURLOPT_DNS_CACHE_TIMEOUT, 0L); // Disable DNS cache
211211
curl_easy_setopt(_curl, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_2_0); // enable HTTP2 Protocol
@@ -227,8 +227,8 @@ - (IBAction)Get:(id)sender
227227
// PERFORM the Curl
228228
theResult = curl_easy_perform(_curl);
229229
if (theResult == CURLE_OK) {
230-
long http_code, http_ver;
231-
double total_time, total_size, total_speed, timing_ns, timing_tcp, timing_ssl, timing_fb;
230+
long http_code, http_ver, total_size, total_speed;
231+
double total_time, timing_ns, timing_tcp, timing_ssl, timing_fb;
232232
char *redirect_url2 = NULL;
233233
curl_easy_getinfo(_curl, CURLINFO_RESPONSE_CODE, &http_code);
234234
curl_easy_getinfo(_curl, CURLINFO_TOTAL_TIME, &total_time);
@@ -256,7 +256,7 @@ - (IBAction)Get:(id)sender
256256
}
257257

258258
// timings
259-
_resultText.text = [_resultText.text stringByAppendingFormat:@"\n** Timing Details **\n-- \tName Lookup:\t%0.2fs\n-- \tTCP Connect: \t%0.2fs\n-- \tSSL Handshake: \t%0.2fs\n-- \tFirst Byte: \t\t%0.2fs\n-- \tTotal Download: \t%0.2fs\n-- Size: %0.0f bytes\n-- Speed: %0.0f bytes/sec\n-- Using: %@\n** RESULT CODE: %ld**",
259+
_resultText.text = [_resultText.text stringByAppendingFormat:@"\n** Timing Details **\n-- \tName Lookup:\t%0.2fs\n-- \tTCP Connect: \t%0.2fs\n-- \tSSL Handshake: \t%0.2fs\n-- \tFirst Byte: \t\t%0.2fs\n-- \tTotal Download: \t%0.2fs\n-- Size: %" CURL_FORMAT_CURL_OFF_T " bytes\n-- Speed: %" CURL_FORMAT_CURL_OFF_T " bytes/sec\n-- Using: %@\n** RESULT CODE: %ld**",
260260
timing_ns,timing_tcp,timing_ssl,timing_fb,
261261
total_time,total_size, total_speed, http_ver_s, http_code];
262262

0 commit comments

Comments
 (0)