]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-10777 [mod_erlang_event] #resolve
authorBruno Dias <dias.h.bruno@gmail.com>
Thu, 8 Mar 2018 00:21:33 +0000 (21:21 -0300)
committerBruno Dias <dias.h.bruno@gmail.com>
Fri, 9 Mar 2018 16:41:24 +0000 (13:41 -0300)
src/mod/event_handlers/mod_erlang_event/ei_helpers.c

index 7d23815585631bd18f9bd94288e72287ae178e0f..cf3a6aca31696a5b2a569b59c0a52c8ecb4b3149 100644 (file)
@@ -64,6 +64,7 @@ void ei_link(listener_t *listener, erlang_pid * from, erlang_pid * to)
        char msgbuf[2048];
        char *s;
        int index = 0;
+       int status = SWITCH_STATUS_SUCCESS;
        switch_socket_t *sock = NULL;
        switch_os_sock_put(&sock, &listener->sockdes, listener->pool);
 
@@ -81,7 +82,8 @@ void ei_link(listener_t *listener, erlang_pid * from, erlang_pid * to)
        /* sum:  542 */
 
        switch_mutex_lock(listener->sock_mutex);
-       if (switch_socket_send(sock, msgbuf, (switch_size_t *) &index)) {
+       status = switch_socket_send(sock, msgbuf, (switch_size_t *) &index);
+       if (status != SWITCH_STATUS_SUCCESS) {
                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Failed to link to process on %s\n", listener->peer_nodename);
        }
        switch_mutex_unlock(listener->sock_mutex);