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

Re: [PATCH 2/2] http-push: refactor curl_easy_setup madness

From
Tay Ray Chuan <rctay89@gmail.com>
Date
Apr 16, 2011, 18:24 UTC
Message-ID
<BANLkTinv4M7biQ_Wd3rWYbGLSwgGBmhbUA@mail.gmail.com>
In-Reply-To
<1301535531-1244-2-git-send-email-dpmcgee@gmail.com>
On Thu, Mar 31, 2011 at 9:38 AM, Dan McGee <dpmcgee@gmail.com> wrote:
Show 7 quoted lines
> We were doing (nearly) the same thing all over the place, in slightly
> different orders, different variable names, etc. Refactor most calls
> into two helper functions, one for GET and one for everything else, that
> do the heavy lifting leaving most callsites a lot cleaner in the
> process.
>
> Signed-off-by: Dan McGee <dpmcgee@gmail.com>
Nice work.

Perhaps you should mention in the commit message that the setting of CURLOPT_PUT at the callsites of curl_setup_http() which previously didn't do it (eg. locking_available(), remote_ls()) is ok, since that option is deprecated in place of, and has the same effect as, CURLOPT_UPLOAD.

Show 11 quoted lines
> --- a/http-push.c
> +++ b/http-push.c
> @@ -169,7 +169,7 @@ enum dav_header_flag {
>        DAV_HEADER_TIMEOUT = (1u << 2)
>  };
>
> -static char *xml_entities(char *s)
> +static char *xml_entities(const char *s)
>  {
>        struct strbuf buf = STRBUF_INIT;
>        while (*s) {

Perhaps the addition of "const", and elsewhere in this patch, should be placed in a separate patch.

-- Cheers, Ray Chuan

Previous: Dan McGeeNext: Junio C Hamano
Message 3 of 5 in “http: make curl callbacks match contracts from curl header”
  1. 1/2 http: make curl callbacks match contracts from curl headerDan McGee, Mar 31, 2011
  2. 2/2 http-push: refactor curl_easy_setup madnessDan McGee, Mar 31, 2011
  3. Tay Ray ChuanApr 16, 2011
  4. Junio C HamanoApr 4, 2011
  5. http: make curl callbacks match contracts from curl headerDan McGee, Apr 5, 2011

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.