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

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Sat Nov 18 15:14:21 MST 2006


Author: rizzo
Date: Sat Nov 18 16:14:20 2006
New Revision: 47834

URL: http://svn.digium.com/view/asterisk?view=rev&rev=47834
Log:
comments-only change:
document a bit more when manager events are delivered
to the clients.


Modified:
    trunk/main/manager.c

Modified: trunk/main/manager.c
URL: http://svn.digium.com/view/asterisk/trunk/main/manager.c?view=diff&rev=47834&r1=47833&r2=47834
==============================================================================
--- trunk/main/manager.c (original)
+++ trunk/main/manager.c Sat Nov 18 16:14:20 2006
@@ -1902,6 +1902,9 @@
 	return 0;
 }
 
+/*!
+ * Send any applicable events to the client listening on this socket
+ */
 static int process_events(struct mansession *s)
 {
 	int ret = 0;
@@ -1994,6 +1997,7 @@
 		astman_send_error(s, m, "Invalid/unknown command");
 	if (ret)
 		return ret;
+	/* Once done with our message, deliver any pending events */
 	return process_events(s);
 }
 
@@ -2046,6 +2050,9 @@
 		ast_mutex_unlock(&s->__lock);
 	}
 	if (res < 0) {
+		/* If we get a signal from some other thread (typically because
+		 * there are new events queued), return 0 to notify the caller.
+		 */
 		if (errno == EINTR)
 			return 0;
 		ast_log(LOG_WARNING, "poll() returned error: %s\n", strerror(errno));
@@ -2065,6 +2072,12 @@
 }
 
 /*! \brief The body of the individual manager session.
+ * Call get_input() to read one line at a time
+ * (or be woken up on new events), collect the lines in a
+ * message until found an empty line, and execute the request.
+ * In any case, deliver events asynchronously through process_events()
+ * (called from here if no line is available, or at the end of
+ * process_message(). )
  */
 static void *session_do(void *data)
 {



More information about the asterisk-commits mailing list