diff options
author | Junio C Hamano <gitster@pobox.com> | 2011-06-29 17:03:12 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2011-06-29 17:03:12 -0700 |
commit | 187e902dd25da5a9f48f35a48e6281faa2f8ac39 (patch) | |
tree | 116dd729b9883c9de4100c1e6beabdd90cc05cab | |
parent | Merge branch 'jk/maint-1.7.2-status-ignored' (diff) | |
parent | http: pass http.cookiefile using CURLOPT_COOKIEFILE (diff) | |
download | tgif-187e902dd25da5a9f48f35a48e6281faa2f8ac39.tar.xz |
Merge branch 'db/http-cookies'
* db/http-cookies:
http: pass http.cookiefile using CURLOPT_COOKIEFILE
-rw-r--r-- | Documentation/config.txt | 8 | ||||
-rw-r--r-- | http.c | 5 |
2 files changed, 13 insertions, 0 deletions
diff --git a/Documentation/config.txt b/Documentation/config.txt index 6b93777199..c631d1cbf9 100644 --- a/Documentation/config.txt +++ b/Documentation/config.txt @@ -1196,6 +1196,14 @@ http.proxy:: environment variable (see linkgit:curl[1]). This can be overridden on a per-remote basis; see remote.<name>.proxy +http.cookiefile:: + File containing previously stored cookie lines which should be used + in the git http session, if they match the server. The file format + of the file to read cookies from should be plain HTTP headers or + the Netscape/Mozilla cookie file format (see linkgit:curl[1]). + NOTE that the file specified with http.cookiefile is only used as + input. No cookies will be stored in the file. + http.sslVerify:: Whether to verify the SSL certificate when fetching or pushing over HTTPS. Can be overridden by the 'GIT_SSL_NO_VERIFY' environment @@ -41,6 +41,7 @@ static long curl_low_speed_limit = -1; static long curl_low_speed_time = -1; static int curl_ftp_no_epsv; static const char *curl_http_proxy; +static const char *curl_cookie_file; static char *user_name, *user_pass; static const char *user_agent; @@ -191,6 +192,9 @@ static int http_options(const char *var, const char *value, void *cb) if (!strcmp("http.proxy", var)) return git_config_string(&curl_http_proxy, var, value); + if (!strcmp("http.cookiefile", var)) + return git_config_string(&curl_cookie_file, var, value); + if (!strcmp("http.postbuffer", var)) { http_post_buffer = git_config_int(var, value); if (http_post_buffer < LARGE_PACKET_MAX) @@ -531,6 +535,7 @@ struct active_request_slot *get_active_slot(void) slot->finished = NULL; slot->callback_data = NULL; slot->callback_func = NULL; + curl_easy_setopt(slot->curl, CURLOPT_COOKIEFILE, curl_cookie_file); curl_easy_setopt(slot->curl, CURLOPT_HTTPHEADER, pragma_header); curl_easy_setopt(slot->curl, CURLOPT_ERRORBUFFER, curl_errorstr); curl_easy_setopt(slot->curl, CURLOPT_CUSTOMREQUEST, NULL); |