git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Jeff King <peff@peff.net>
To: Nicolas Morey-Chaisemartin <nicolas@morey-chaisemartin.com>
Cc: git@vger.kernel.org
Subject: Re: [RFC 0/3] imap-send curl tunnelling support
Date: Thu, 24 Aug 2017 07:28:41 -0700	[thread overview]
Message-ID: <20170824142841.wqcbjwaajhy5ppvl@sigill.intra.peff.net> (raw)
In-Reply-To: <2875ec38-9d22-ef94-28e5-7b9c6855139d@morey-chaisemartin.com>

On Thu, Aug 24, 2017 at 04:15:04PM +0200, Nicolas Morey-Chaisemartin wrote:

> >> 1) There does not seem to be an easy/clean workaround for the lack of socketpair on windows.
> >> Fidling with a loopback AF_UNIX?AF_LOCAL socket should work but it
> >> means creating a socket file somewhere which pulls a lot of potential
> >> issues (where to put it ? Post-mortem cleanup ? Parallel imap-send ?)
> > Even if you create a non-anonymous socket and connect to both ends, I'm
> > not sure how it works to pass that to the spawned child. IIRC, our
> > run_command emulation cannot pass arbitrary descriptors to the child
> > processes (but I don't know the details of why that is the case, or if
> > there are windows-specific calls we could be making to work around it).
> Well as long as we can map it on a fd, the dup2 trickery should allow to remap whatever solution we pick to stdin/stdout.
> Could this code be put in a #ifndef WINDOWS ?

Good point. So yeah, in theory you could emulate socketpair() with a
temporary path to do the rendezvous. Just bind/listen/accept in a
non-blocking way, then connect() from the same process, then close() the
listener and delete the socket path.

Of course that doesn't work if you don't have AF_UNIX in the first
place. You could always do the same trick with TCP sockets over the
loopback, but now you get the added bonus of wondering whether whoever
connected is the other half of your process. ;)

I dunno. I am well out of my range of Windows knowledge, and I don't
have a system to test on to determine whether my suggestions are going
completely off the deep end.

-Peff

  reply	other threads:[~2017-08-24 14:28 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-09 14:43 [RFC 0/3] imap-send curl tunnelling support Nicolas Morey-Chaisemartin
2017-08-09 14:46 ` [RFC 1/3] imap-send: move tunnel setup to its own function Nicolas Morey-Chaisemartin
2017-08-09 14:46 ` [RFC 2/3] imap-send: use a socketpair instead of pipe to communicate with the tunnel Nicolas Morey-Chaisemartin
2017-08-09 14:46 ` [RFC 3/3] imap_send: add support for curl over tunnel Nicolas Morey-Chaisemartin
2017-08-15 17:49 ` [RFC 0/3] imap-send curl tunnelling support Nicolas Morey-Chaisemartin
2017-08-15 18:18   ` Stefan Beller
2017-08-16 12:30     ` Johannes Schindelin
2017-08-21  7:27       ` Nicolas Morey-Chaisemartin
2017-08-22 17:10         ` Johannes Sixt
2017-08-22 18:22           ` Nicolas Morey-Chaisemartin
2017-08-23 22:35           ` Johannes Schindelin
2017-08-16  8:34 ` Jeff King
2017-08-21  7:34   ` Nicolas Morey-Chaisemartin
2017-08-23 21:43     ` Jeff King
2017-08-24  8:00       ` Nicolas Morey-Chaisemartin
2017-08-24 13:53         ` Jeff King
2017-08-24 14:02           ` Daniel Stenberg
2017-08-24 14:30             ` Jeff King
2017-08-24 21:22               ` Daniel Stenberg
2017-08-24 14:15           ` Nicolas Morey-Chaisemartin
2017-08-24 14:28             ` Jeff King [this message]
     [not found] ` <7ee8331d-e154-7539-e000-4087406f39fa@suse.de>
2017-08-16  8:39   ` Jeff King

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=20170824142841.wqcbjwaajhy5ppvl@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=nicolas@morey-chaisemartin.com \
    /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).