[Freeswitch-svn] [commit] r10946 - freeswitch/trunk/libs/esl/src

FreeSWITCH SVN anthm at freeswitch.org
Fri Dec 26 08:43:03 PST 2008


Author: anthm
Date: Fri Dec 26 11:43:03 2008
New Revision: 10946

Log:
fix bug

Modified:
   freeswitch/trunk/libs/esl/src/esl.c

Modified: freeswitch/trunk/libs/esl/src/esl.c
==============================================================================
--- freeswitch/trunk/libs/esl/src/esl.c	(original)
+++ freeswitch/trunk/libs/esl/src/esl.c	Fri Dec 26 11:43:03 2008
@@ -861,11 +861,11 @@
 		esl_log(ESL_LOG_DEBUG, "SEND\n%s\n", cmd);
 	}
 	
-	if (send(handle->sock, cmd, strlen(cmd), 0)) {
+	if (send(handle->sock, cmd, strlen(cmd), 0) != strlen(cmd)) {
 		strerror_r(handle->errnum, handle->err, sizeof(handle->err));
 		return ESL_FAIL;
 	}
-
+	
 	if (!(*e == '\n' && *(e-1) == '\n')) {
 		if (send(handle->sock, "\n\n", 2, 0)) {
 			strerror_r(handle->errnum, handle->err, sizeof(handle->err));
@@ -884,7 +884,11 @@
 	esl_status_t status;
 	
 	esl_mutex_lock(handle->mutex);
-	esl_send(handle, cmd);
+
+	if ((status = esl_send(handle, cmd))) {
+		return status;
+	}
+
 	status = esl_recv_event(handle, &handle->last_sr_event);
 	
 	if (handle->last_sr_event) {



More information about the Freeswitch-svn mailing list