[Asterisk-code-review] Message.c: Clear message channel frames on cleanup (asterisk[certified/11.6])
Jonathan Rose
asteriskteam at digium.com
Fri Sep 4 11:44:14 CDT 2015
Jonathan Rose has uploaded a new change for review.
https://gerrit.asterisk.org/1185
Change subject: Message.c: Clear message channel frames on cleanup
......................................................................
Message.c: Clear message channel frames on cleanup
The message channel is a special channel that doesn't actually process frames.
However, certain actions can cause frames to be placed in the channel's read
queue including the Hangup application which is called on the channel after
each message is processed. Since the channel will continually be reused for
many messages, it's necessary to flush these frames at some point.
ASTERISK-25083 #close
Reported by: Jonathan Rose
Change-Id: Idf18df73ccd8c220be38743335b5c79c2a4c0d0f
(cherry picked from commit 02c513058905dae19f28393ea840a47ae4a9e66d)
---
M main/message.c
1 file changed, 8 insertions(+), 0 deletions(-)
git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/85/1185/1
diff --git a/main/message.c b/main/message.c
index bb98e24..a324d84 100644
--- a/main/message.c
+++ b/main/message.c
@@ -720,6 +720,7 @@
struct ast_datastore *msg_ds, *ds;
struct varshead *headp;
struct ast_var_t *vardata;
+ struct ast_frame *cur;
ast_channel_lock(chan);
@@ -749,6 +750,13 @@
}
/*
+ * Remove frames from read queue
+ */
+ while ((cur = AST_LIST_REMOVE_HEAD(ast_channel_readq(chan), frame_list))) {
+ ast_frfree(cur);
+ }
+
+ /*
* Restore msg datastore.
*/
if (msg_ds) {
--
To view, visit https://gerrit.asterisk.org/1185
To unsubscribe, visit https://gerrit.asterisk.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Idf18df73ccd8c220be38743335b5c79c2a4c0d0f
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: certified/11.6
Gerrit-Owner: Jonathan Rose <jrose at digium.com>
More information about the asterisk-code-review
mailing list