Re: [PATCH] http-push: refactor lock-related headers creation for curl requests
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Jan 24, 2009, 04:11 UTC
- Message-ID
- <alpine.DEB.1.00.0901240507070.13232@racer>
- In-Reply-To
- <be6fef0d0901231800t6943b01dwbca976d5e9f3397@mail.gmail.com>
Hi,
On Sat, 24 Jan 2009, Ray Chuan wrote:
> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Make that an Acked-by:
> + if(options & DAV_HEADER_IF) {
> + strbuf_addf(&buf, "If: (<%s>)", lock->token);
> + dav_headers = curl_slist_append(dav_headers, buf.buf);
> + strbuf_reset(&buf);BTW in case anyone is puzzled (like I was): curl_slist_append() takes a "char *" as second parameter, but does not take custody of the buffer; instead, it strdup()s it. See http://cool.haxx.se/cvs.cgi/curl/lib/sendf.c?rev=1.155&content-type=text/vnd.viewcvs-markup for details.
BTNW this should be mentioned in the commit message, too, to spare other people the puzzlement.
Ciao, Dscho