Blob Blame History Raw
From: Razvan Crainea <razvan@opensips.org>
Date: Mon, 4 Jun 2018 10:55:01 +0300
Subject: [PATCH] proto_*: check returned events from poll

Inspired from ticket #1374

(cherry picked from commit 52e54daa0ff989537d2381c905744b1b898387ad)

diff --git a/modules/proto_bin/proto_bin.c b/modules/proto_bin/proto_bin.c
index 807ea4720..766d49c05 100644
--- a/modules/proto_bin/proto_bin.c
+++ b/modules/proto_bin/proto_bin.c
@@ -290,7 +290,7 @@ poll_loop:
 		}
 	}
 
-	if (pf.events&POLLOUT)
+	if (pf.revents&POLLOUT)
 		goto again;
 
 	/* some other events triggered by poll - treat as errors */
diff --git a/modules/proto_hep/proto_hep.c b/modules/proto_hep/proto_hep.c
index 798e48020..f6dcf6928 100644
--- a/modules/proto_hep/proto_hep.c
+++ b/modules/proto_hep/proto_hep.c
@@ -434,7 +434,7 @@ poll_loop:
 		}
 	}
 
-	if (pf.events&POLLOUT)
+	if (pf.revents&POLLOUT)
 		goto again;
 
 	/* some other events triggered by poll - treat as errors */