[svn-commits] mnicholson: branch 1.8 r311141 - in /branches/1.8: ./ main/manager.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Thu Mar 17 10:00:38 CDT 2011


Author: mnicholson
Date: Thu Mar 17 10:00:33 2011
New Revision: 311141

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=311141
Log:
Merged revisions 311140 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.6.2

........
  r311140 | mnicholson | 2011-03-17 09:58:52 -0500 (Thu, 17 Mar 2011) | 4 lines
  
  Don't write items to the manager socket twice.
  
  AST-2011-003
........

Modified:
    branches/1.8/   (props changed)
    branches/1.8/main/manager.c

Propchange: branches/1.8/
------------------------------------------------------------------------------
Binary property 'branch-1.6.2-merged' - no diff available.

Modified: branches/1.8/main/manager.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.8/main/manager.c?view=diff&rev=311141&r1=311140&r2=311141
==============================================================================
--- branches/1.8/main/manager.c (original)
+++ branches/1.8/main/manager.c Thu Mar 17 10:00:33 2011
@@ -1846,6 +1846,9 @@
 static int send_string(struct mansession *s, char *string)
 {
 	int res;
+	FILE *f = s->f ? s->f : s->session->f;
+	int fd = s->f ? s->fd : s->session->fd;
+
 	/* It's a result from one of the hook's action invocation */
 	if (s->hook) {
 		/*
@@ -1854,9 +1857,9 @@
 		 */
 		s->hook->helper(EVENT_FLAG_HOOKRESPONSE, "HookResponse", string);
 		return 0;
-	}	else if (s->f && (res = ast_careful_fwrite(s->f, s->fd, string, strlen(string), s->session->writetimeout))) {
-		s->write_error = 1;
-	} else if ((res = ast_careful_fwrite(s->session->f, s->session->fd, string, strlen(string), s->session->writetimeout))) {
+	}
+       
+	if ((res = ast_careful_fwrite(f, fd, string, strlen(string), s->session->writetimeout))) {
 		s->write_error = 1;
 	}
 




More information about the svn-commits mailing list