mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-19 03:08:45 +00:00
the default port number was erroneously stored in host order,
and reading from the config file used ntohs instead of htons. this ought to be merged to 1.4 as well. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@45836 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -628,7 +628,7 @@ static int __ast_http_load(int reload)
|
|||||||
char newprefix[MAX_PREFIX];
|
char newprefix[MAX_PREFIX];
|
||||||
|
|
||||||
memset(&sin, 0, sizeof(sin));
|
memset(&sin, 0, sizeof(sin));
|
||||||
sin.sin_port = 8088;
|
sin.sin_port = htons(8088);
|
||||||
strcpy(newprefix, DEFAULT_PREFIX);
|
strcpy(newprefix, DEFAULT_PREFIX);
|
||||||
cfg = ast_config_load("http.conf");
|
cfg = ast_config_load("http.conf");
|
||||||
if (cfg) {
|
if (cfg) {
|
||||||
@@ -639,7 +639,7 @@ static int __ast_http_load(int reload)
|
|||||||
else if (!strcasecmp(v->name, "enablestatic"))
|
else if (!strcasecmp(v->name, "enablestatic"))
|
||||||
newenablestatic = ast_true(v->value);
|
newenablestatic = ast_true(v->value);
|
||||||
else if (!strcasecmp(v->name, "bindport"))
|
else if (!strcasecmp(v->name, "bindport"))
|
||||||
sin.sin_port = ntohs(atoi(v->value));
|
sin.sin_port = htons(atoi(v->value));
|
||||||
else if (!strcasecmp(v->name, "bindaddr")) {
|
else if (!strcasecmp(v->name, "bindaddr")) {
|
||||||
if ((hp = ast_gethostbyname(v->value, &ahp))) {
|
if ((hp = ast_gethostbyname(v->value, &ahp))) {
|
||||||
memcpy(&sin.sin_addr, hp->h_addr, sizeof(sin.sin_addr));
|
memcpy(&sin.sin_addr, hp->h_addr, sizeof(sin.sin_addr));
|
||||||
|
Reference in New Issue
Block a user