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

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:

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
I fixed that in CVS (and I'm just generating a snapshot).

Works with postfix.


Problem reports:
Unsubscribe info:

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