connect() hangs on a listen()ing AF_UNIX socket

Corinna Vinschen corinna-cygwin@cygwin.com
Wed Oct 8 12:39:00 GMT 2014


On Sep 25 16:24, Christian Franke wrote:
> Corinna Vinschen wrote:
> >On Aug 26 21:03, Christian Franke wrote:
> >>Corinna Vinschen wrote:
> >>>Sounds like a nice idea.  We should try that.  I'm just not sure how
> >>>much time I have left to work on this before my vaca next month.  Do you
> >>>have fun to look into that?  We have waited so long for postfix, I guess
> >>>a couple more weeks won't really hurt.
> >>OK, will try that
> >Cool!  Don't hesitate to discuss implementation details on the
> >cygwin-developers list.
> 
> Unfortunately, a very first prototype did not work. If receiving of
> secret+cred is delayed until first send()/recv(), postfix hangs in first
> send() after the connect(). During startup, the postfix master calls
> connect() and first client send() before corresponding server accept() is
> called.

Yeah, that's tricky.  The handshake at send/recv time requires some
ordering which we can't enforce.  Too bad.

In theory, if the SO_PEERCRED stuff wouldn't be required for openssh,
we could really do without the handshake.  The peers are restricted to
the local machine anyway, and as with all communication, the peers have
to know the protocol.

> So I decided to provide a intermediate solution for now, see:
> https://cygwin.com/ml/cygwin-patches/2014-q3/msg00015.html

Thanks!  I'll look into it in the next couple of days.

> For the long term, this approach may work or not:
> Remove the complete handshake over TCP. Maintain a table of current TCP
> connections in the socket "file". The table contains pid, TCP port and
> credentials for the server which did the (first) listen() call and for all
> connected clients. Some hashes could be added to check for validity.

Yeah, we should try to come up with another technique.  Off the top of
my head I'm not sure if the above is feasible, but we should certainly
discuss this further.


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin/attachments/20141008/c4c561af/attachment.sig>


More information about the Cygwin mailing list