git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 3/3] http-push: avoid new compile error

From
Junio C Hamano <gitster@pobox.com>
Date
Sep 21, 2025, 15:09 UTC
Message-ID
<xmqq7bxrx2nx.fsf@gitster.g>
In-Reply-To
<bcb231125c95ff809c618eedab71375b94e6c69e.1758457356.git.gitgitgadget@gmail.com>

"Johannes Schindelin via GitGitGadget" <gitgitgadget@gmail.com> writes:

Show 13 quoted lines
> However, there is a much better solution: To use the
> `CURLOPT_INFILESIZE_LARGE` option instead, which was added in cURL
> v7.11.0 (see https://curl.se/ch/7.11.0.html) and which Git _already_
> uses in `curl_append_msgs_to_imap()`.
>
> This fix was the motivation for renaming `xcurl_off_t()` to
> `cast_size_t_to_curl_off_t()` and making it available more broadly,
> which is the reason why it is used here, too.
>
> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
> ---
>  http-push.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)

As we saw in [1/3], we have been using "size large" for posting in remote-curl.c and this brings how the size for reading the data is handled to match that.

Looking good.  
Will queue.  Thanks.
Show 14 quoted lines
> diff --git a/http-push.c b/http-push.c
> index 91a5465afb..7a9b96a6d0 100644
> --- a/http-push.c
> +++ b/http-push.c
> @@ -208,7 +208,8 @@ static void curl_setup_http(CURL *curl, const char *url,
>  	curl_easy_setopt(curl, CURLOPT_UPLOAD, 1L);
>  	curl_easy_setopt(curl, CURLOPT_URL, url);
>  	curl_easy_setopt(curl, CURLOPT_INFILE, buffer);
> -	curl_easy_setopt(curl, CURLOPT_INFILESIZE, buffer->buf.len);
> +	curl_easy_setopt(curl, CURLOPT_INFILESIZE_LARGE,
> +			 cast_size_t_to_curl_off_t(buffer->buf.len));
>  	curl_easy_setopt(curl, CURLOPT_READFUNCTION, fread_buffer);
>  	curl_easy_setopt(curl, CURLOPT_SEEKFUNCTION, seek_buffer);
>  	curl_easy_setopt(curl, CURLOPT_SEEKDATA, buffer);
Previous: Johannes Schindelin via GitGitGadgetNext: Johannes Schindelin via GitGitGadget
Message 7 of 12 in “Fix curl_easy_setopt() parameter type problem, again”
  1. 0/3 Fix curl_easy_setopt() parameter type problem, againJohannes Schindelin via GitGitGadget, Sep 21, 2025
  2. 1/3 http: offer to cast `size_t` to `curl_off_t` safelyJohannes Schindelin via GitGitGadget, Sep 21, 2025
  3. Junio C HamanoSep 21, 2025
  4. 2/3 imap-send: be more careful when casting to `curl_off_t`Johannes Schindelin via GitGitGadget, Sep 21, 2025
  5. Junio C HamanoSep 21, 2025
  6. 3/3 http-push: avoid new compile errorJohannes Schindelin via GitGitGadget, Sep 21, 2025
  7. Junio C HamanoSep 21, 2025
  8. 0/3 Fix curl_easy_setopt() parameter type problem, againJohannes Schindelin via GitGitGadget, Sep 26, 2025
  9. 1/3 http: offer to cast `size_t` to `curl_off_t` safelyJohannes Schindelin via GitGitGadget, Sep 26, 2025
  10. 2/3 imap-send: be more careful when casting to `curl_off_t`Johannes Schindelin via GitGitGadget, Sep 26, 2025
  11. 3/3 http-push: avoid new compile errorJohannes Schindelin via GitGitGadget, Sep 26, 2025
  12. Junio C HamanoSep 26, 2025

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.