public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Christian Franke <Christian.Franke@t-online.de>
To: cygwin@cygwin.com
Subject: Re: connect() hangs on a listen()ing AF_UNIX socket
Date: Thu, 25 Sep 2014 14:35:00 -0000	[thread overview]
Message-ID: <5424259D.2090304@t-online.de> (raw)
In-Reply-To: <20140826205643.GD5740@calimero.vinschen.de>

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.

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

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.


>> Postfix apparently pushes Cygwin to its limits. With a test cygwin1.dll
>> where the secret+cred exchange is fully disabled, postfix starts up but
>> queuing of mail fails.
>>
>> This is because fchmod() is called on a file rename()d after open():
>>
>> fd = open("tempfile", ., 0600);
>> // use fd's inode number and current time to create unique "queuefile".
>> rename("tempfile", "queuefile");
>> write(fd, "SOME MAIL....", .);
>> fchmod(fd, 0700); // fails with ENOENT on Cygwin (because it does a
>> chmod("tempfile",.)?)
>> close(fd);
> I fixed that in CVS (and I'm just generating a snapshot).

Works with postfix.

Thanks,
Christian


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

  parent reply	other threads:[~2014-09-25 14:24 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-21 16:17 Christian Franke
2014-08-21 16:44 ` Corinna Vinschen
2014-08-21 19:14   ` Christian Franke
2014-08-22  9:39     ` Corinna Vinschen
2014-08-22 18:32       ` Christian Franke
2014-08-22 20:16         ` Corinna Vinschen
2014-08-26 19:03           ` Christian Franke
2014-08-26 20:56             ` Corinna Vinschen
2014-08-27  8:58               ` Achim Gratz
2014-08-27  9:50                 ` Corinna Vinschen
2014-08-27 10:12                   ` Corinna Vinschen
2014-08-27 17:57                     ` Achim Gratz
2014-08-28  9:57                       ` Corinna Vinschen
2014-09-25 14:35               ` Christian Franke [this message]
2014-10-08 12:39                 ` Corinna Vinschen

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5424259D.2090304@t-online.de \
    --to=christian.franke@t-online.de \
    --cc=cygwin@cygwin.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.
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).