Change in libosmocore[master]: select: Call log_reset_context() before calling file descriptor callb...

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Harald Welte gerrit-no-reply at lists.osmocom.org
Fri Feb 22 21:22:28 UTC 2019


Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/12998 )

Change subject: select: Call log_reset_context() before calling file descriptor callbacks
......................................................................

select: Call log_reset_context() before calling file descriptor callbacks

Make sure to clear any log context before processing the next incoming message
as part of some file descriptor callback.  This effectively prevents "context
leaking" from processing of one message into processing of the next message as part
of one iteration through the list of file descriptors here.

Change-Id: I3644c7bc1a9cec5858eb0faf94efc8c3ba7f5d8d
Closes: OS#3813
---
M src/select.c
1 file changed, 6 insertions(+), 0 deletions(-)

Approvals:
  Jenkins Builder: Verified
  Pau Espin Pedrol: Looks good to me, but someone else must approve
  daniel: Looks good to me, approved



diff --git a/src/select.c b/src/select.c
index b594ca5..4e7be35 100644
--- a/src/select.c
+++ b/src/select.c
@@ -35,6 +35,7 @@
 #include <osmocom/core/select.h>
 #include <osmocom/core/linuxlist.h>
 #include <osmocom/core/timer.h>
+#include <osmocom/core/logging.h>
 
 #include "../config.h"
 
@@ -214,6 +215,11 @@
 
 		if (flags) {
 			work = 1;
+			/* make sure to clear any log context before processing the next incoming message
+			 * as part of some file descriptor callback.  This effectively prevents "context
+			 * leaking" from processing of one message into processing of the next message as part
+			 * of one iteration through the list of file descriptors here.  See OS#3813 */
+			log_reset_context();
 			ufd->cb(ufd, flags);
 		}
 		/* ugly, ugly hack. If more than one filedescriptor was

-- 
To view, visit https://gerrit.osmocom.org/12998
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I3644c7bc1a9cec5858eb0faf94efc8c3ba7f5d8d
Gerrit-Change-Number: 12998
Gerrit-PatchSet: 1
Gerrit-Owner: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder (1000002)
Gerrit-Reviewer: Pau Espin Pedrol <pespin at sysmocom.de>
Gerrit-Reviewer: daniel <dwillmann at sysmocom.de>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190222/869e43c6/attachment.htm>


More information about the gerrit-log mailing list