diff options
author | Junio C Hamano <gitster@pobox.com> | 2013-06-27 14:29:49 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2013-06-27 14:29:49 -0700 |
commit | dc2ed04c23e59bf2ea93021fdb3660d7ded1f46c (patch) | |
tree | f6583b94c88b66d3cb0498d65249a431743c6cbf /http.c | |
parent | 9df9bdda3a2450fe97ba4db61ce4d46c81fbfc16 (diff) | |
parent | a94cf2cb7e77c27ce5c3d648e37c1aa75cd5e56e (diff) | |
download | git-dc2ed04c23e59bf2ea93021fdb3660d7ded1f46c.tar.gz |
Merge branch 'bc/http-keep-memory-given-to-curl'
Older cURL wanted piece of memory we call it with to be stable, but
we updated the auth material after handing it to a call.
* bc/http-keep-memory-given-to-curl:
http.c: don't rewrite the user:passwd string multiple times
Diffstat (limited to 'http.c')
-rw-r--r-- | http.c | 12 |
1 files changed, 9 insertions, 3 deletions
@@ -228,9 +228,15 @@ static void init_curl_http_auth(CURL *result) #else { static struct strbuf up = STRBUF_INIT; - strbuf_reset(&up); - strbuf_addf(&up, "%s:%s", - http_auth.username, http_auth.password); + /* + * Note that we assume we only ever have a single set of + * credentials in a given program run, so we do not have + * to worry about updating this buffer, only setting its + * initial value. + */ + if (!up.len) + strbuf_addf(&up, "%s:%s", + http_auth.username, http_auth.password); curl_easy_setopt(result, CURLOPT_USERPWD, up.buf); } #endif |