提交 1c9604e9 authored 作者: Brian West's avatar Brian West

FS-1307 Don't load event socket on bind error

上级 d97b163f
...@@ -5,5 +5,6 @@ ...@@ -5,5 +5,6 @@
<param name="listen-port" value="8021"/> <param name="listen-port" value="8021"/>
<param name="password" value="ClueCon"/> <param name="password" value="ClueCon"/>
<!--<param name="apply-inbound-acl" value="lan"/>--> <!--<param name="apply-inbound-acl" value="lan"/>-->
<!--<param name="stop-on-bind-error" value="true"/>-->
</settings> </settings>
</configuration> </configuration>
...@@ -127,6 +127,7 @@ static struct { ...@@ -127,6 +127,7 @@ static struct {
uint32_t acl_count; uint32_t acl_count;
uint32_t id; uint32_t id;
int nat_map; int nat_map;
int stop_on_bind_error;
} prefs; } prefs;
...@@ -2740,6 +2741,8 @@ static int config(void) ...@@ -2740,6 +2741,8 @@ static int config(void)
} else { } else {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Max acl records of %d reached\n", MAX_ACL); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Max acl records of %d reached\n", MAX_ACL);
} }
} else if (!strcasecmp(var, "stop-on-bind-error")) {
prefs.stop_on_bind_error = switch_true(val) ? 1 : 0;
} }
} }
} }
...@@ -2819,6 +2822,10 @@ SWITCH_MODULE_RUNTIME_FUNCTION(mod_event_socket_runtime) ...@@ -2819,6 +2822,10 @@ SWITCH_MODULE_RUNTIME_FUNCTION(mod_event_socket_runtime)
break; break;
sock_fail: sock_fail:
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Socket Error! Could not listen on %s:%u\n", prefs.ip, prefs.port); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Socket Error! Could not listen on %s:%u\n", prefs.ip, prefs.port);
if (prefs.stop_on_bind_error) {
prefs.done = 1;
goto fail;
}
switch_yield(100000); switch_yield(100000);
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论