[asterisk-commits] rizzo: trunk r45696 - /trunk/main/manager.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Thu Oct 19 10:26:21 MST 2006


Author: rizzo
Date: Thu Oct 19 12:26:20 2006
New Revision: 45696

URL: http://svn.digium.com/view/asterisk?rev=45696&view=rev
Log:
more fixes to comments and very minor code rearrangement.


Modified:
    trunk/main/manager.c

Modified: trunk/main/manager.c
URL: http://svn.digium.com/view/asterisk/trunk/main/manager.c?rev=45696&r1=45695&r2=45696&view=diff
==============================================================================
--- trunk/main/manager.c (original)
+++ trunk/main/manager.c Thu Oct 19 12:26:20 2006
@@ -126,7 +126,7 @@
 	char inbuf[AST_MAX_MANHEADER_LEN];	/*! Buffer */
 	int inlen;		/*! number of buffered bytes */
 	int send_events;	/* XXX what ? */
-	struct eventqent *eventq;	/* Queued events that we've not had the ability to send yet */
+	struct eventqent *eventq;	/* last event processed. */
 	int writetimeout;	/* Timeout for ast_carefulwrite() */
 	AST_LIST_ENTRY(mansession) list;
 };
@@ -1005,7 +1005,7 @@
 			    ((s->send_events & eqe->category) == eqe->category)) {
 				astman_append(s, "%s", eqe->eventdata);
 			}
-			unref_event(s->eventq);	/* XXX why not eqe ? */
+			unref_event(s->eventq);
 			s->eventq = eqe;
 		}
 		astman_append(s,
@@ -2020,12 +2020,13 @@
  */
 static int append_event(const char *str, int category)
 {
-	struct eventqent *tmp, *prev = NULL;
-	tmp = ast_malloc(sizeof(*tmp) + strlen(str));
+	struct eventqent *prev = NULL;
+	struct eventqent *tmp = ast_malloc(sizeof(*tmp) + strlen(str));
 
 	if (!tmp)
 		return -1;
 
+	/* need to init all fields, because ast_malloc() does not */
 	tmp->next = NULL;
 	tmp->category = category;
 	strcpy(tmp->eventdata, str);



More information about the asterisk-commits mailing list