]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
deal with blank api command replies in es
authorAnthony Minessale <anthony.minessale@gmail.com>
Thu, 6 Mar 2008 18:12:38 +0000 (18:12 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Thu, 6 Mar 2008 18:12:38 +0000 (18:12 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@7803 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/mod/event_handlers/mod_event_socket/mod_event_socket.c

index 42e7a1ad86d1a5aaaefd4cd0f5b1ee395453013e..34988c8b202e3e494f3f6df10d68fd8248421f7f 100644 (file)
@@ -604,7 +604,12 @@ static void *SWITCH_THREAD_FUNC api_exec(switch_thread_t * thread, void *obj)
        } else {
                switch_size_t rlen, blen;
                char buf[1024] = "";
-               rlen = strlen(reply);
+
+               if (!(rlen = strlen(reply))) {
+                       reply = "-ERR no reply\n";
+                       rlen = strlen(reply);
+               }
+
                switch_snprintf(buf, sizeof(buf), "Content-Type: api/response\nContent-Length: %" SWITCH_SSIZE_T_FMT "\n\n", rlen);
                blen = strlen(buf);
                switch_socket_send(acs->listener->sock, buf, &blen);