Update of /cvsroot/monetdb/sql/src/backends/monet5/merovingian
In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv28011
Modified Files:
merovingian_proxy.c
Log Message:
resolve client disconnect that sometimes happens when using fd passing, it
turned out that socket_getsock didn't really return the socket all the time
Index: merovingian_proxy.c
===================================================================
RCS file:
/cvsroot/monetdb/sql/src/backends/monet5/merovingian/merovingian_proxy.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- merovingian_proxy.c 22 Mar 2010 14:34:52 -0000 1.7
+++ merovingian_proxy.c 24 Mar 2010 12:47:56 -0000 1.8
@@ -75,7 +75,7 @@
}
static err
-startProxy(stream *cfdin, stream *cfout, char *url, char *client)
+startProxy(int psock, stream *cfdin, stream *cfout, char *url, char *client)
{
struct hostent *hp;
struct sockaddr_in server;
@@ -119,7 +119,6 @@
struct cmsghdr *cmsg;
struct iovec vec;
char buf[1];
- int psock = socket_getsock(cfdin);
if ((ssock = socket(PF_UNIX, SOCK_STREAM, 0)) < 0)
return(newErr("cannot open socket: %s",
strerror(errno)));
@@ -153,8 +152,11 @@
close(ssock);
return(newErr("could not send initial byte: %s",
strerror(errno)));
}
+ /* block until the server acknowledges that it has psock
+ * connected with itself */
+ recv(ssock, buf, 1, 0);
+ close(ssock);
close(psock);
-
close_stream(cfdin);
close_stream(cfout);
return(NO_ERR);
------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Monetdb-sql-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-sql-checkins