[asterisk-commits] simon.perreault: branch group/v6-new r272651 - /team/group/v6-new/main/http.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Jun 28 09:45:27 CDT 2010


Author: simon.perreault
Date: Mon Jun 28 09:45:24 2010
New Revision: 272651

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=272651
Log:
Don't use casts just for printing.

Modified:
    team/group/v6-new/main/http.c

Modified: team/group/v6-new/main/http.c
URL: http://svnview.digium.com/svn/asterisk/team/group/v6-new/main/http.c?view=diff&rev=272651&r1=272650&r2=272651
==============================================================================
--- team/group/v6-new/main/http.c (original)
+++ team/group/v6-new/main/http.c Mon Jun 28 09:45:24 2010
@@ -298,7 +298,6 @@
 {
 	struct ast_str *out;
 	struct ast_variable *v, *cookies = NULL;
-	struct sockaddr_in tmp;
 
 	if (method != AST_HTTP_GET && method != AST_HTTP_HEAD) {
 		ast_http_error(ser, 501, "Not Implemented", "Attempt to use unimplemented / unsupported method");
@@ -316,15 +315,13 @@
 		"<h2>&nbsp;&nbsp;Asterisk&trade; HTTP Status</h2></td></tr>\r\n");
 
 	ast_str_append(&out, 0, "<tr><td><i>Prefix</i></td><td><b>%s</b></td></tr>\r\n", prefix);
-	ast_sockaddr_to_sin(&http_desc.old_address, &tmp);
 	ast_str_append(&out, 0, "<tr><td><i>Bind Address</i></td><td><b>%s</b></td></tr>\r\n",
-		       ast_inet_ntoa(tmp.sin_addr));
-	ast_str_append(&out, 0, "<tr><td><i>Bind Port</i></td><td><b>%d</b></td></tr>\r\n",
-		       ntohs(tmp.sin_port));
+		       ast_sockaddr_stringify_addr(&http_desc.old_address));
+	ast_str_append(&out, 0, "<tr><td><i>Bind Port</i></td><td><b>%s</b></td></tr>\r\n",
+		       ast_sockaddr_stringify_port(&http_desc.old_address));
 	if (http_tls_cfg.enabled) {
-		ast_sockaddr_to_sin(&https_desc.old_address, &tmp);
-		ast_str_append(&out, 0, "<tr><td><i>SSL Bind Port</i></td><td><b>%d</b></td></tr>\r\n",
-			       ntohs(tmp.sin_port));
+		ast_str_append(&out, 0, "<tr><td><i>SSL Bind Port</i></td><td><b>%s</b></td></tr>\r\n",
+			       ast_sockaddr_stringify_port(&https_desc.old_address));
 	}
 	ast_str_append(&out, 0, "<tr><td colspan=\"2\"><hr></td></tr>\r\n");
 	for (v = get_vars; v; v = v->next) {




More information about the asterisk-commits mailing list