git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Spencer E. Olson <olsonse@umich.edu>
Date
Aug 7, 2010, 17:29 UTC
Message-ID
<1281202184.4815.1.camel@compaq.olson.home>
In-Reply-To
<AANLkTinyohKaACbheGR2Q=-K5sWwv+y1u1-3b2WPzxVh@mail.gmail.com>

I would have no problem doing that. I was just trying to match the style already present in http.c. All the other pointer tests in that function/file are done the same.

On Sat, 2010-08-07 at 08:34 +0000, Ævar Arnfjörð Bjarmason wrote:
Show 16 quoted lines
> On Sat, Aug 7, 2010 at 03:34, Spencer E. Olson <olsonse@umich.edu> wrote:
> 
> > -       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);
> 
> Can't you just skip the != NULL?:
> 
>        if (user_agent)
>                curl_easy_setopt(result, CURLOPT_USERAGENT, user_agent);
>        else
>                curl_easy_setopt(result, CURLOPT_USERAGENT, GIT_USER_AGENT);
> 
> 
Previous: Ævar Arnfjörð BjarmasonNext: Ævar Arnfjörð Bjarmason
Message 3 of 14 in “Allow HTTP user agent string to be modified.”
  1. Allow HTTP user agent string to be modified.Spencer E. Olson, Aug 7, 2010
  2. Ævar Arnfjörð BjarmasonAug 7, 2010
  3. Spencer E. OlsonAug 7, 2010
  4. Ævar Arnfjörð BjarmasonAug 7, 2010
  5. Tay Ray ChuanAug 8, 2010
  6. Tay Ray ChuanAug 8, 2010
  7. Spencer E. OlsonAug 8, 2010
  8. Allow HTTP user agent string to be modified.Spencer E. Olson, Aug 11, 2010
  9. Tay Ray ChuanAug 11, 2010
  10. Junio C HamanoAug 11, 2010
  11. Allow HTTP user agent string to be modified.Spencer E. Olson, Aug 11, 2010
  12. Jacob HelwigAug 11, 2010
  13. Allow HTTP user agent string to be modified.Spencer E. Olson, Aug 11, 2010
  14. Junio C HamanoAug 12, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.