Permalink
Browse files

Test program no longer used

  • Loading branch information...
1 parent 1514eea commit 0a226cd4a57cd65ba7a0266cb96b33f4b5db022c @petdance committed Apr 13, 2012
Showing with 0 additions and 84 deletions.
  1. +0 −84 hanger
View
84 hanger
@@ -1,84 +0,0 @@
-#!perl
-
-# This program only exists to figure out why perl 5.12.0 RC1 hangs when
-# trying to test PUT in Test::WWW::Mechanize.
-
-use strict;
-use warnings;
-
-use WWW::Mechanize;
-
-my $server = HangServer->new;
-my $pid = $server->background;
-print "Running as pid $pid\n";
-my $server_root = $server->root;
-
-my $mech = WWW::Mechanize->new;
-
-GOOD_GET: {
- my $goodlinks = "$server_root/goodlinks.html";
- $mech->get( $goodlinks );
- $mech->success or die "Unable to get $goodlinks";
- print "=== GET content ===\n";
- print $mech->content, "\n";
- print "=== GET content ===\n";
-}
-
-print "\n\nHit enter to do a PUT. You can also go elsewhere and connect to $server_root";
-my $f = <>;
-
-GOOD_GET: {
- my $scraps = "$server_root/scraps.html";
- $mech->put( $scraps );
- print "=== PUT content ===\n";
- print $mech->content, "\n";
- print "=== PUT content ===\n";
- print 'Success in the PUT? ', ($mech->success ? 'YES' : 'NO'), '\n';
-}
-
-print "\n\nHit enter to down the server";
-$f = <>;
-
-print "Killing pid $pid\n";
-kill( 9, $pid ) unless $^S;
-
-print "Server stopped\n";
-
-exit;
-
-
-package HangServer;
-
-use warnings;
-use strict;
-
-use base 'HTTP::Server::Simple::CGI';
-
-sub new {
- my $class = shift;
-
- # XXX This should really be a random port.
- return $class->SUPER::new(13432, @_);
-}
-
-sub handle_request {
- my $self = shift;
- my $cgi = shift;
-
- use Data::Dumper; local $Data::Dumper::Sortkeys=1;
- my $response = Dumper($cgi);
- $response .= '$cgi->path_info is [' . $cgi->path_info . ']';
-
- print "HTTP/1.0 200 OK\r\n";
- print "Content-Type: text/html\r\nContent-Length: ", length($response), "\r\n\r\n", $response;
- return;
-}
-
-sub root {
- my $self = shift;
- my $port = $self->port;
-
- return "http://localhost:$port";
-}
-
-1;

0 comments on commit 0a226cd

Please sign in to comment.