This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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

Attachment: pgpGJN4YHulLg.pgp
Description: PGP signature


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]