Changeset: 64ed78fd35b7 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=64ed78fd35b7
Modified Files:
tools/merovingian/daemon/controlrunner.c
Branch: Dec2016
Log Message:
Merge with Jun2016 branch.
diffs (46 lines):
diff --git a/tools/merovingian/daemon/controlrunner.c
b/tools/merovingian/daemon/controlrunner.c
--- a/tools/merovingian/daemon/controlrunner.c
+++ b/tools/merovingian/daemon/controlrunner.c
@@ -930,6 +930,17 @@ control_handleclient(const char *host, i
ctl_handle_client(host, sock, fdin, fout);
}
+static void *
+handle_client(void *p)
+{
+ int msgsock = * (int *) p;
+
+ ctl_handle_client("(local)", msgsock, NULL, NULL);
+ shutdown(msgsock, SHUT_RDWR);
+ closesocket(msgsock);
+ return NULL;
+}
+
void *
controlRunner(void *d)
{
@@ -939,7 +950,7 @@ controlRunner(void *d)
fd_set fds;
struct timeval tv;
int msgsock;
- char origin[128];
+ pthread_t tid;
do {
FD_ZERO(&fds);
@@ -975,11 +986,10 @@ controlRunner(void *d)
continue;
}
- snprintf(origin, sizeof(origin), "(local)");
-
- ctl_handle_client(origin, msgsock, NULL, NULL);
- shutdown(msgsock, SHUT_RDWR);
- closesocket(msgsock);
+ if (pthread_create(&tid, NULL, handle_client, &msgsock) != 0)
+ closesocket(msgsock);
+ else
+ pthread_detach(tid);
} while (_mero_keep_listening);
shutdown(usock, SHUT_RDWR);
closesocket(usock);
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list