Thread (9 messages) 9 messages, 3 authors, 2016-06-15

Re: [PATCH v2] Allow HTTP user agent string to be modified.

flat view

From: Tay Ray Chuan <hidden>
Date: 2016-06-15 22:49:16

Hi,

On Sat, Aug 7, 2010 at 11:34 AM, Spencer E. Olson [off-list ref] wrote:
quoted hunk ↗ jump to hunk
[snip]
@@ -41,6 +41,7 @@ static long curl_low_speed_time = -1;
 static int curl_ftp_no_epsv;
 static const char *curl_http_proxy;
 static char *user_name, *user_pass;
+static const char *user_agent = NULL;
This can be skipped, I think.
quoted hunk ↗ jump to hunk
[snip]
@@ -279,7 +283,10 @@ static CURL *get_curl_handle(void)
       if (getenv("GIT_CURL_VERBOSE"))
               curl_easy_setopt(result, CURLOPT_VERBOSE, 1);

-       curl_easy_setopt(result, CURLOPT_USERAGENT, GIT_USER_AGENT);
+       if (user_agent != NULL)
+               curl_easy_setopt(result, CURLOPT_USERAGENT, user_agent);
+       else
+               curl_easy_setopt(result, CURLOPT_USERAGENT, GIT_USER_AGENT);
Hmm, perhaps

    curl_easy_setopt(result, CURLOPT_USERAGENT,
        user_agent ? user_agent : GIT_USER_AGENT);

to replace the if-else?

-- 
Cheers,
Ray Chuan
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help