X-Git-Url: http://sjero.net/git/?a=blobdiff_plain;f=tests%2FHTTPServer.pm;h=e3c38e6f5f02c31a580813591b6e21a2726a6dc2;hb=30385d6c5dfc341fdce111392dbc55e5cdb9202a;hp=57b0499faa47df2c109210f6c9fb59769a457c65;hpb=c60c7b9941da3756a0b46130dfa15ad31132dbfa;p=wget diff --git a/tests/HTTPServer.pm b/tests/HTTPServer.pm index 57b0499f..e3c38e6f 100644 --- a/tests/HTTPServer.pm +++ b/tests/HTTPServer.pm @@ -1,8 +1,7 @@ -#!/usr/bin/perl -w - package HTTPServer; use strict; +use warnings; use HTTP::Daemon; use HTTP::Status; @@ -23,7 +22,7 @@ sub run { if (!$initialized) { $synch_callback->(); $initialized = 1; - } + } my $con = $self->accept(); print STDERR "Accepted a new connection\n" if $log; while (my $req = $con->get_request) { @@ -45,14 +44,14 @@ sub run { if (exists($urls->{$url_path})) { print STDERR "Serving requested URL: ", $url_path, "\n" if $log; next unless ($req->method eq "HEAD" || $req->method eq "GET"); - + my $url_rec = $urls->{$url_path}; $self->send_response($req, $url_rec, $con); } else { print STDERR "Requested wrong URL: ", $url_path, "\n" if $log; $con->send_error($HTTP::Status::RC_FORBIDDEN); last; - } + } } print STDERR "Closing connection\n" if $log; $con->close;