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

Re: [PATCH 0/5] transport: unify ipv4 and ipv6 code paths

From
Jonathan Nieder <jrnieder@gmail.com>
Date
Jun 14, 2012, 05:02 UTC
Message-ID
<20120614050203.GE27586@burratino>
In-Reply-To
<CABPQNSb9EGOgHb7NtsEtDh2QkjkHYn7YemYsa8Yaqyuce-aDMw@mail.gmail.com>
Erik Faye-Lund wrote:
> On Thu, Mar 8, 2012 at 1:48 PM, Jonathan Nieder <jrnieder@gmail.com> wrote:
Show 5 quoted lines
>> Patch 4 is the heart of the series.  It provides an interface similar
>> to getaddrinfo that can be implemented on top of either gethostbyname
>> or getaddrinfo and puts each implementation in a separate file.  This
>> way, callers can just use the common API and they do not need to have
>> two copies of their code, one for each host resolution API.
[...]
> What happened to this series?

It seemed nice in principle, but if I understood correctly then the API was too complicated for anyone but me to like it. Instead of an interface similar to getaddrinfo, it would probably be better to implement an interface _identical_ to getaddrinfo for the the subset of functionality that git uses.

See [1] for example for proof that that's possible.

I would make some different choices from Russ if doing it myself --- e.g., I would want to unconditionally use

	#define getaddrinfo git_getaddrinfo

when NO_IPV6 is set so testing these code paths would be as simple as enabling NO_IPV6, even on systems that also provide the modern API in libc.

Hoping that clarifies, Jonathan

[1] http://git.eyrie.org/?p=devel/rra-c-util.git;a=tree;f=portable
Previous: Junio C Hamano
Message 20 of 20 in “transport: unify ipv4 and ipv6 code paths”
  1. 0/5 transport: unify ipv4 and ipv6 code pathsJonathan Nieder, Mar 8, 2012
  2. 1/5 transport: expose git_tcp_connect() and friends in new tcp.hJonathan Nieder, Mar 8, 2012
  3. Erik Faye-LundMar 8, 2012
  4. 2/5 daemon: make host resolution a separate functionJonathan Nieder, Mar 8, 2012
  5. 3/5 daemon: move locate_host() to tcp libJonathan Nieder, Mar 8, 2012
  6. 4/5 tcp: unify ipv4 and ipv6 code pathsJonathan Nieder, Mar 8, 2012
  7. Erik Faye-LundMar 8, 2012
  8. Jonathan NiederMar 8, 2012
  9. 5/5 daemon: check for errors retrieving IP addressJonathan Nieder, Mar 8, 2012
  10. 6/5 tcp: make dns_resolve() return an error codeJonathan Nieder, Mar 8, 2012
  11. 7/5 transport: optionally honor DNS SRV recordsJonathan Nieder, Mar 8, 2012
  12. Erik Faye-LundMar 8, 2012
  13. Jonathan NiederMar 8, 2012
  14. Johannes SixtMar 9, 2012
  15. Jonathan NiederMar 9, 2012
  16. 8/5 srv: tolerate broken DNS repliesJonathan Nieder, Mar 8, 2012
  17. Richard HartmannMar 8, 2012
  18. Erik Faye-LundJun 11, 2012
  19. Junio C HamanoJun 11, 2012
  20. Jonathan NiederJun 14, 2012

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.