[Pkg-voip-commits] [janus] 164/282: Added EINTR checks for all poll() calls (fixes pfunix issue at startup)

Jonas Smedegaard dr at jones.dk
Wed Dec 20 21:53:37 UTC 2017


This is an automated email from the git hooks/post-receive script.

js pushed a commit to annotated tag debian/0.2.6-1
in repository janus.

commit a2ba8fa80163506aff10d2a851ea1862e2c62e5f
Author: Lorenzo Miniero <lminiero at gmail.com>
Date:   Thu Nov 2 18:52:07 2017 +0100

    Added EINTR checks for all poll() calls (fixes pfunix issue at startup)
---
 plugins/janus_nosip.c     | 4 ++++
 plugins/janus_sip.c       | 4 ++++
 plugins/janus_sipre.c     | 4 ++++
 transports/janus_pfunix.c | 6 +++++-
 4 files changed, 17 insertions(+), 1 deletion(-)

diff --git a/plugins/janus_nosip.c b/plugins/janus_nosip.c
index a1c1330..09230c9 100644
--- a/plugins/janus_nosip.c
+++ b/plugins/janus_nosip.c
@@ -1829,6 +1829,10 @@ static void *janus_nosip_relay_thread(void *data) {
 		/* Wait for some data */
 		resfd = poll(fds, num, 1000);
 		if(resfd < 0) {
+			if(errno == EINTR) {
+				JANUS_LOG(LOG_HUGE, "[NoSIP-%p] Got an EINTR (%s), ignoring...\n", session, strerror(errno));
+				continue;
+			}
 			JANUS_LOG(LOG_ERR, "[NoSIP-%p] Error polling...\n", session);
 			JANUS_LOG(LOG_ERR, "[NoSIP-%p]   -- %d (%s)\n", session, errno, strerror(errno));
 			break;
diff --git a/plugins/janus_sip.c b/plugins/janus_sip.c
index a43f893..ad3511f 100644
--- a/plugins/janus_sip.c
+++ b/plugins/janus_sip.c
@@ -3804,6 +3804,10 @@ static void *janus_sip_relay_thread(void *data) {
 		/* Wait for some data */
 		resfd = poll(fds, num, 1000);
 		if(resfd < 0) {
+			if(errno == EINTR) {
+				JANUS_LOG(LOG_HUGE, "[SIP-%s] Got an EINTR (%s), ignoring...\n", session->account.username, strerror(errno));
+				continue;
+			}
 			JANUS_LOG(LOG_ERR, "[SIP-%s] Error polling...\n", session->account.username);
 			JANUS_LOG(LOG_ERR, "[SIP-%s]   -- %d (%s)\n", session->account.username, errno, strerror(errno));
 			break;
diff --git a/plugins/janus_sipre.c b/plugins/janus_sipre.c
index d1c6acb..0a83c0d 100644
--- a/plugins/janus_sipre.c
+++ b/plugins/janus_sipre.c
@@ -2998,6 +2998,10 @@ static void *janus_sipre_relay_thread(void *data) {
 		/* Wait for some data */
 		resfd = poll(fds, num, 1000);
 		if(resfd < 0) {
+			if(errno == EINTR) {
+				JANUS_LOG(LOG_HUGE, "[SIPre-%s] Got an EINTR (%s), ignoring...\n", session->account.username, strerror(errno));
+				continue;
+			}
 			JANUS_LOG(LOG_ERR, "[SIPre-%s] Error polling...\n", session->account.username);
 			JANUS_LOG(LOG_ERR, "[SIPre-%s]   -- %d (%s)\n", session->account.username, errno, strerror(errno));
 			break;
diff --git a/transports/janus_pfunix.c b/transports/janus_pfunix.c
index aca171c..e589b27 100644
--- a/transports/janus_pfunix.c
+++ b/transports/janus_pfunix.c
@@ -492,7 +492,11 @@ void *janus_pfunix_thread(void *data) {
 		if(res == 0)
 			continue;
 		if(res < 0) {
-			JANUS_LOG(LOG_ERR, "poll() failed\n");
+			if(errno == EINTR) {
+				JANUS_LOG(LOG_HUGE, "Got an EINTR (%s) polling the Unix Sockets descriptors, ignoring...\n", strerror(errno));
+				continue;
+			}
+			JANUS_LOG(LOG_ERR, "poll() failed: %d (%s)\n", errno, strerror(errno));
 			break;
 		}
 		int i = 0;

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-voip/janus.git



More information about the Pkg-voip-commits mailing list