aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrizzo <rizzo@f38db490-d61c-443f-a65b-d21fe96a405b>2006-10-21 20:24:04 +0000
committerrizzo <rizzo@f38db490-d61c-443f-a65b-d21fe96a405b>2006-10-21 20:24:04 +0000
commit98620b2aefeee5ae15f15e63d84c091328f86fc2 (patch)
tree53e1c13415b3294b88c82181860ef6c1523f5799
parent577ae460a7ec07f830f9ad2f2a2cc7e6ea8306b7 (diff)
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: http://svn.digium.com/svn/asterisk/trunk@45836 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r--main/http.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/main/http.c b/main/http.c
index 5da224e35..4a14cb15b 100644
--- a/main/http.c
+++ b/main/http.c
@@ -628,7 +628,7 @@ static int __ast_http_load(int reload)
char newprefix[MAX_PREFIX];
memset(&sin, 0, sizeof(sin));
- sin.sin_port = 8088;
+ sin.sin_port = htons(8088);
strcpy(newprefix, DEFAULT_PREFIX);
cfg = ast_config_load("http.conf");
if (cfg) {
@@ -639,7 +639,7 @@ static int __ast_http_load(int reload)
else if (!strcasecmp(v->name, "enablestatic"))
newenablestatic = ast_true(v->value);
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")) {
if ((hp = ast_gethostbyname(v->value, &ahp))) {
memcpy(&sin.sin_addr, hp->h_addr, sizeof(sin.sin_addr));