]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
urldata: make redirect counter 16 bit
authorDaniel Stenberg <daniel@haxx.se>
Wed, 15 Oct 2025 08:56:47 +0000 (10:56 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Wed, 15 Oct 2025 10:34:33 +0000 (12:34 +0200)
Instead of long (up to 64-bit) as the maximum allowed value set since
b059f7deaf3 is 0x7fff. Saves 2 or 6 bytes.

Closes #19072

lib/urldata.h

index e181e294bb27ec0a89227a60fe22ef09dcbac4f9..c7e19201fe886ceaf7bfb7d8a42434031684083b 100644 (file)
@@ -981,7 +981,6 @@ struct UrlState {
   int first_remote_port;
   curl_prot_t first_remote_protocol;
   int os_errno;  /* filled in with errno whenever an error occurs */
-  long followlocation; /* redirect counter */
   int requests; /* request counter: redirects + authentication retakes */
 #ifdef HAVE_SIGNAL
   /* storage for the previous bag^H^H^HSIGPIPE signal handler :-) */
@@ -1101,6 +1100,7 @@ struct UrlState {
 #ifndef CURL_DISABLE_HTTP
   struct http_negotiation http_neg;
 #endif
+  unsigned short followlocation; /* redirect counter */
   unsigned char retrycount; /* number of retries on a new connection, up to
                                CONN_MAX_RETRIES */
   unsigned char httpreq; /* Curl_HttpReq; what kind of HTTP request (if any)