[svn-commits] rizzo: trunk r45836 - /trunk/main/http.c

svn-commits at lists.digium.com svn-commits at lists.digium.com
Sat Oct 21 13:24:05 MST 2006


Author: rizzo
Date: Sat Oct 21 15:24:04 2006
New Revision: 45836

URL: http://svn.digium.com/view/asterisk?rev=45836&view=rev
Log:
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.


Modified:
    trunk/main/http.c

Modified: trunk/main/http.c
URL: http://svn.digium.com/view/asterisk/trunk/main/http.c?rev=45836&r1=45835&r2=45836&view=diff
==============================================================================
--- trunk/main/http.c (original)
+++ trunk/main/http.c Sat Oct 21 15:24:04 2006
@@ -628,7 +628,7 @@
 	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 @@
 			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));



More information about the svn-commits mailing list