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

Re: [PATCH 3/4] imap_send: setup_curl: use server_conf parameter instead of the global variable

From
Jeff King <peff@peff.net>
Date
Aug 7, 2017, 19:50 UTC
Message-ID
<20170807195003.clo2vmnmufmfalb6@sigill.intra.peff.net>
In-Reply-To
<71817815-4e52-4623-b226-bbb57ca08047@morey-chaisemartin.com>
On Mon, Aug 07, 2017 at 07:06:07PM +0200, Nicolas Morey-Chaisemartin wrote:
Show 22 quoted lines
> >> -       server_fill_credential(&server);
> >> -       curl_easy_setopt(curl, CURLOPT_USERNAME, server.user);
> >> -       curl_easy_setopt(curl, CURLOPT_PASSWORD, server.pass);
> >> +       server_fill_credential(srvc);
> >> +       curl_easy_setopt(curl, CURLOPT_USERNAME, srvc->user);
> >> +       curl_easy_setopt(curl, CURLOPT_PASSWORD, srvc->pass);
> > Here you change the server_fill_credential-call that you just added.
> > Maybe do this patch earlier, perhaps even as patch 1?
> >
> > I'm snipping lots of s/server/srvc/-changes... There's a less noisy
> > way of addressing the fact that srvc is unused: dropping it. I'm not
> > saying that's a good idea, but it could be considered, then explained
> > why this approach is better. There are some other functions which
> > access "server" directly, and some which take (and use!) a "srvc".
> > Maybe make the whole file consistent?
> >
> That's why I applied it after #2. I was not sure if this one made
> sense or not. And it  can be dropped with the rest of the series still
> applying.
> I don't know what is the right approach here. Someone with more
> knowledge of why there is a mix of global variable and local can maybe
> help ?

I suspect it's just code in need of a cleanup. But let's cc the original author of 1e16b255b (git-imap-send: use libcurl for implementation, 2014-11-09) to see if he has any comments[1].

-Peff
[1] Bernhard, the whole series is at:
      https://public-inbox.org/git/38d3ae5b-4020-63cc-edfa-0a77e42798b8@morey-chaisemartin.com/
    The general idea is to make sure the original and curl imap-send
    implementations have feature parity, make the curl version the
    default, and then hopefully eventually drop the non-curl one
    entirely.
Previous: Nicolas Morey-ChaisemartinNext: Nicolas Morey-Chaisemartin
Message 5 of 13 in “imap_send: setup_curl: prompt user for username/password if not set in config file”
  1. 2/4 imap_send: setup_curl: prompt user for username/password if not set in config fileNicolas Morey-Chaisemartin, Aug 7, 2017
  2. 3/4 imap_send: setup_curl: use server_conf parameter instead of the global variableNicolas Morey-Chaisemartin, Aug 7, 2017
  3. Martin ÅgrenAug 7, 2017
  4. Nicolas Morey-ChaisemartinAug 7, 2017
  5. Jeff KingAug 7, 2017
  6. 4/4 imap-send: use curl by defaultNicolas Morey-Chaisemartin, Aug 7, 2017
  7. Martin ÅgrenAug 7, 2017
  8. Nicolas Morey-ChaisemartinAug 7, 2017
  9. Martin ÅgrenAug 7, 2017
  10. Jeff KingAug 7, 2017
  11. Junio C HamanoSep 12, 2017
  12. Junio C HamanoSep 12, 2017
  13. Nicolas Morey-ChaisemartinSep 12, 2017

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.