Re: [PATCH 1/3] http-push: prefer CURLOPT_UPLOAD to CURLOPT_PUT
- From
Ramsay Jones <ramsay@ramsayjones.plus.com>
- Date
- Jan 15, 2023, 20:54 UTC
- Message-ID
- <c77892ba-e5cd-1192-ceba-d49edcb95da8@ramsayjones.plus.com>
- In-Reply-To
- <Y8RduNqadAfaOgs1@coredump.intra.peff.net>
On 15/01/2023 20:10, Jeff King wrote:
Show 20 quoted lines
> The two options do exactly the same thing, but the latter has been
> deprecated and in recent versions of curl may produce a compiler
> warning. Since the UPLOAD form is available everywhere (it was
> introduced in the year 2000 by curl 7.1), we can just switch to it.
>
> Signed-off-by: Jeff King <peff@peff.net>
> ---
> http-push.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/http-push.c b/http-push.c
> index 5f4340a36e..1b18e775d0 100644
> --- a/http-push.c
> +++ b/http-push.c
> @@ -198,7 +198,7 @@ static void curl_setup_http(CURL *curl, const char *url,
> const char *custom_req, struct buffer *buffer,
> curl_write_callback write_fn)
> {
> - curl_easy_setopt(curl, CURLOPT_PUT, 1);
> + curl_easy_setopt(curl, CURLOPT_UPLOAD, 1);My version of this patch had '1L' rather than just '1' - but it doesn't really matter (and was probably because all the curl examples did so!).
LGTM
ATB, Ramsay Jones
> curl_easy_setopt(curl, CURLOPT_URL, url); > curl_easy_setopt(curl, CURLOPT_INFILE, buffer); > curl_easy_setopt(curl, CURLOPT_INFILESIZE, buffer->buf.len);