]> err.no Git - varnish/commitdiff
Fixed so that server_host is the hostname and not IP, as javscript will fail if the...
authorpetter <petter@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Fri, 12 Dec 2008 11:47:32 +0000 (11:47 +0000)
committerpetter <petter@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Fri, 12 Dec 2008 11:47:32 +0000 (11:47 +0000)
git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@3462 d4fa192b-c00b-0410-8231-f00ffab90ce4

varnish-tools/webgui/Varnish/RequestHandler.pm

index 8943215167da7a8ecb69d58a0aa65427b1642d60..3730d8cdf9bf10e9661c0f06f3d468a0f4bb0b5f 100644 (file)
@@ -13,6 +13,7 @@ use URI::Escape;
 use GD::Graph::lines;
 use POSIX qw(strftime);
 use List::Util qw(first);
+use Socket;
 
 {
        my %request_ref_of;
@@ -29,7 +30,9 @@ use List::Util qw(first);
                $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;