[Freeswitch-svn] [commit] r7766 - freeswitch/trunk/src/mod/event_handlers/mod_event_socket
Freeswitch SVN
mikej at freeswitch.org
Fri Feb 29 10:39:57 EST 2008
Author: mikej
Date: Fri Feb 29 10:39:56 2008
New Revision: 7766
Modified:
freeswitch/trunk/src/mod/event_handlers/mod_event_socket/mod_event_socket.c
Log:
tweak error handling on socket app
Modified: freeswitch/trunk/src/mod/event_handlers/mod_event_socket/mod_event_socket.c
==============================================================================
--- freeswitch/trunk/src/mod/event_handlers/mod_event_socket/mod_event_socket.c (original)
+++ freeswitch/trunk/src/mod/event_handlers/mod_event_socket/mod_event_socket.c Fri Feb 29 10:39:56 2008
@@ -223,18 +223,18 @@
return;
}
- switch_channel_set_variable(channel, "socket_host", host);
-
if ((port_name = strchr(host, ':'))) {
*port_name++ = '\0';
port = (switch_port_t) atoi(port_name);
}
- if ((path = strchr(port_name, '/'))) {
+ if ((path = strchr((port_name ? port_name : host), '/'))) {
*path++ = '\0';
switch_channel_set_variable(channel, "socket_path", path);
}
+ switch_channel_set_variable(channel, "socket_host", host);
+
if (switch_sockaddr_info_get(&sa, host, AF_INET, port, 0, switch_core_session_get_pool(session)) != SWITCH_STATUS_SUCCESS) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Socket Error!\n");
return;
More information about the Freeswitch-svn
mailing list