]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
http2: fix variable type
authorMarcel Raad <Marcel.Raad@teamviewer.com>
Mon, 12 Jun 2023 14:02:00 +0000 (16:02 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Wed, 14 Jun 2023 07:30:37 +0000 (09:30 +0200)
`max_recv_speed` is `curl_off_t`, so using `size_t` might result in
-Wconversion GCC warnings for 32-bit `size_t`. Visible in the NetBSD
ARM autobuilds.

Closes https://github.com/curl/curl/pull/11312

lib/http2.c

index 7e2b4377fbf90c8dffc1cbd5423a1e313cf33a5a..c5779a61646742167b477917cae15c19b443170a 100644 (file)
@@ -1992,7 +1992,7 @@ static ssize_t h2_submit(struct stream_ctx **pstream,
      * Let's limit our stream window size around that, otherwise the server
      * will send in large bursts only. We make the window 50% larger to
      * allow for data in flight and avoid stalling. */
-    size_t n = (((data->set.max_recv_speed - 1) / H2_CHUNK_SIZE) + 1);
+    curl_off_t n = (((data->set.max_recv_speed - 1) / H2_CHUNK_SIZE) + 1);
     n += CURLMAX((n/2), 1);
     if(n < (H2_STREAM_WINDOW_SIZE / H2_CHUNK_SIZE) &&
        n < (UINT_MAX / H2_CHUNK_SIZE)) {