git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Tay Ray Chuan <rctay89@gmail.com>
To: "Spencer E. Olson" <olsonse@umich.edu>
Cc: git@vger.kernel.org, Nick Hengeveld <nickh@reactrix.com>,
	Mark Lodato <lodatom@gmail.com>,
	"Shawn O. Pearce" <spearce@spearce.org>
Subject: Re: [PATCH v2] Allow HTTP user agent string to be modified.
Date: Sun, 8 Aug 2010 10:51:55 +0800	[thread overview]
Message-ID: <AANLkTi=G=GvxXEh1hGuYQK42cdkMUaFhqxsQ39K=2180@mail.gmail.com> (raw)
In-Reply-To: <1281152060-16736-1-git-send-email-olsonse@umich.edu>

Hi,

On Sat, Aug 7, 2010 at 11:34 AM, Spencer E. Olson <olsonse@umich.edu> wrote:
>[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.

>[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

  parent reply	other threads:[~2010-08-08  2:52 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-07  3:34 [PATCH v2] Allow HTTP user agent string to be modified Spencer E. Olson
2010-08-07  8:34 ` Ævar Arnfjörð Bjarmason
2010-08-07 17:29   ` Spencer E. Olson
2010-08-07 17:39     ` Ævar Arnfjörð Bjarmason
2010-08-08  2:49     ` Tay Ray Chuan
2010-08-08  2:51 ` Tay Ray Chuan [this message]
2010-08-08  3:57   ` Spencer E. Olson
2010-08-11  5:24   ` [PATCH v3] " Spencer E. Olson
2010-08-11  8:04     ` Tay Ray Chuan
2010-08-11 20:08     ` Junio C Hamano
2010-08-11 20:32       ` [PATCH v4] " Spencer E. Olson
2010-08-11 20:35         ` Jacob Helwig
2010-08-11 20:40           ` [PATCH v5] " Spencer E. Olson
2010-08-12 17:23             ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='AANLkTi=G=GvxXEh1hGuYQK42cdkMUaFhqxsQ39K=2180@mail.gmail.com' \
    --to=rctay89@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=lodatom@gmail.com \
    --cc=nickh@reactrix.com \
    --cc=olsonse@umich.edu \
    --cc=spearce@spearce.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).