This is the mail archive of the
mailing list for the Cygwin project.
Re: connect() hangs on a listen()ing AF_UNIX socket
- From: Christian Franke <Christian dot Franke at t-online dot de>
- To: cygwin at cygwin dot com
- Date: Thu, 25 Sep 2014 16:24:29 +0200
- Subject: Re: connect() hangs on a listen()ing AF_UNIX socket
- Authentication-results: sourceware.org; auth=none
- References: <53F61B70 dot 2020600 at t-online dot de> <20140821164402 dot GB21065 at calimero dot vinschen dot de> <53F6450C dot 3070007 at t-online dot de> <20140822093923 dot GA12878 at calimero dot vinschen dot de> <53F78CB1 dot 9080406 at t-online dot de> <20140822201622 dot GM32314 at calimero dot vinschen dot de> <53FCD9EC dot 1080703 at t-online dot de> <20140826205643 dot GD5740 at calimero dot vinschen dot 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
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()
So I decided to provide a intermediate solution for now, see:
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".
write(fd, "SOME MAIL....", .);
fchmod(fd, 0700); // fails with ENOENT on Cygwin (because it does a
I fixed that in CVS (and I'm just generating a snapshot).
Works with postfix.
Problem reports: http://cygwin.com/problems.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple