summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: fc55d35)
raw | patch | inline | side by side (parent: fc55d35)
author | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Thu, 25 Sep 2008 20:31:29 +0000 (20:31 +0000) | ||
committer | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Thu, 25 Sep 2008 20:31:29 +0000 (20:31 +0000) |
* connection threads exit without closing client socket
(so client blocks waiting for response that never comes)
* listen_queue_thread blocks on poll() until a new connection comes in
(because no poll timeout specified)
-- kevin brintnall
git-svn-id: svn://svn.oetiker.ch/rrdtool/trunk@1525 a5681a0c-68f1-0310-ab6d-d61299d08faa
(so client blocks waiting for response that never comes)
* listen_queue_thread blocks on poll() until a new connection comes in
(because no poll timeout specified)
-- kevin brintnall
git-svn-id: svn://svn.oetiker.ch/rrdtool/trunk@1525 a5681a0c-68f1-0310-ab6d-d61299d08faa
program/src/rrd_daemon.c | patch | blob | history |
index f1221e3e3cb347ba8155b59840c37e127a2880dd..c438028134ed5c27b2f89edf8853c529d1c1ad89 100644 (file)
--- a/program/src/rrd_daemon.c
+++ b/program/src/rrd_daemon.c
status = handle_request (fd, buffer, /*buffer_size=*/ status);
if (status != 0)
- {
- close (fd);
break;
- }
}
+ close(fd);
+
self = pthread_self ();
/* Remove this thread from the connection threads list */
pthread_mutex_lock (&connection_threads_lock);
@@ -1748,8 +1747,12 @@ static void *listen_thread_main (void *args __attribute__((unused))) /* {{{ */
pollfds[i].revents = 0;
}
- status = poll (pollfds, pollfds_num, /* timeout = */ -1);
- if (status < 1)
+ status = poll (pollfds, pollfds_num, /* timeout = */ 1000);
+ if (status == 0)
+ {
+ continue; /* timeout */
+ }
+ else if (status < 0)
{
status = errno;
if (status != EINTR)