diff mbox series

[1/3] http-push: prefer CURLOPT_UPLOAD to CURLOPT_PUT

Message ID Y8YQBbjjf+i8BWL6@coredump.intra.peff.net (mailing list archive)
State Superseded
Headers show
Series [1/3] http-push: prefer CURLOPT_UPLOAD to CURLOPT_PUT | expand

Commit Message

Jeff King Jan. 17, 2023, 3:03 a.m. UTC
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(-)

Comments

Jeff King Jan. 17, 2023, 3:04 a.m. UTC | #1
On Mon, Jan 16, 2023 at 10:03:33PM -0500, Jeff King wrote:

> 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>

Whoops, this was supposed to be part of v2, but I accidentally sent it
in reply to the wrong part of the thread. Please ignore, and I'll resend
in the right spot.

-Peff
diff mbox series

Patch

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);
 	curl_easy_setopt(curl, CURLOPT_URL, url);
 	curl_easy_setopt(curl, CURLOPT_INFILE, buffer);
 	curl_easy_setopt(curl, CURLOPT_INFILESIZE, buffer->buf.len);