]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
fix bug
authorAnthony Minessale <anthony.minessale@gmail.com>
Fri, 26 Dec 2008 16:43:03 +0000 (16:43 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Fri, 26 Dec 2008 16:43:03 +0000 (16:43 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@10946 d0543943-73ff-0310-b7d9-9358b9ac24b2

libs/esl/src/esl.c

index 48d839c7a2fa2464cb18e7a6a41dffb85e3c3ce2..a94e219c47cba5d6f15e148d2388d1962146e691 100644 (file)
@@ -861,11 +861,11 @@ ESL_DECLARE(esl_status_t) esl_send(esl_handle_t *handle, const char *cmd)
                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_DECLARE(esl_status_t) esl_send_recv(esl_handle_t *handle, const char *cmd)
        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) {