r3462 - trunk/varnish-tools/webgui/Varnish

petter at projects.linpro.no petter at projects.linpro.no
Fri Dec 12 12:47:32 CET 2008


Author: petter
Date: 2008-12-12 12:47:32 +0100 (Fri, 12 Dec 2008)
New Revision: 3462

Modified:
   trunk/varnish-tools/webgui/Varnish/RequestHandler.pm
Log:
Fixed so that server_host is the hostname and not IP, as javscript will fail if the URL doesn't match.

Modified: trunk/varnish-tools/webgui/Varnish/RequestHandler.pm
===================================================================
--- trunk/varnish-tools/webgui/Varnish/RequestHandler.pm	2008-12-12 10:10:05 UTC (rev 3461)
+++ trunk/varnish-tools/webgui/Varnish/RequestHandler.pm	2008-12-12 11:47:32 UTC (rev 3462)
@@ -13,6 +13,7 @@
 use GD::Graph::lines;
 use POSIX qw(strftime);
 use List::Util qw(first);
+use Socket;
 
 {
 	my %request_ref_of;
@@ -29,7 +30,9 @@
 		$response_content_ref_of{$new_object} = \"";
 		$response_header_ref_of{$new_object} = {};
 
-		$master_tmpl_var_of{$new_object}->{'server_host'} = $connection->sockhost();
+		my $server_ip = $connection->sockhost();
+		my $server_hostname = gethostbyaddr(inet_aton($server_ip), AF_INET);
+		$master_tmpl_var_of{$new_object}->{'server_host'} = $server_hostname;
 		$master_tmpl_var_of{$new_object}->{'server_port'} = $connection->sockport();
 
 		return $new_object;



More information about the varnish-commit mailing list