[poe-commits] SF.net SVN: poe: [2093] trunk/extras/smoker.perl
Brought to you by:
rcaputo
From: <bin...@us...> - 2006-09-03 14:43:51
|
Revision: 2093 http://svn.sourceforge.net/poe/?rev=2093&view=rev Author: bingosnet Date: 2006-09-03 07:43:44 -0700 (Sun, 03 Sep 2006) Log Message: ----------- Switched smoker.perl to LWP::UserAgent. This way it'll work on MSWin32 too. Modified Paths: -------------- trunk/extras/smoker.perl Modified: trunk/extras/smoker.perl =================================================================== --- trunk/extras/smoker.perl 2006-09-03 06:23:35 UTC (rev 2092) +++ trunk/extras/smoker.perl 2006-09-03 14:43:44 UTC (rev 2093) @@ -13,8 +13,9 @@ use Cwd; use File::Basename; use Getopt::Long; -use POE qw(Wheel::Run Component::Client::UserAgent); -use HTTP::Request::Common; +use POE qw(Wheel::Run); +#use HTTP::Request::Common; +use LWP::UserAgent; my $make = ( $^O eq 'MSWin32' ? 'nmake.exe' : 'make' ); my $perl = ( $^O eq 'MSWin32' ? 'perl.exe' : '/usr/bin/perl' ); @@ -50,7 +51,7 @@ $pasteurl .= ( ( $pasteurl !~ m,/$, ) ? '/' : '' ) . 'paste'; -POE::Component::Client::UserAgent->new(); +#POE::Component::Client::UserAgent->new(); POE::Session->create( package_states => [ @@ -89,10 +90,14 @@ my ($kernel,$heap) = @_[KERNEL,HEAP]; my $todo = shift @{ $heap->{todo} }; unless ( $todo ) { - my $postback = $_[SESSION]->postback('_response'); + #my $postback = $_[SESSION]->postback('_response'); my %formdata = ( channel => $channel, nick => $name, summary => "Results of $result smoke (" . $Config{archname} . "): " . ( $heap->{status} ? 'Problem with tests' : 'All tests successful' ), paste => join( "\n", @{ $heap->{output} }, "\n\n", Config::myconfig() ) ); - my $request = HTTP::Request::Common::POST( $pasteurl => [ %formdata ] ); - $poe_kernel -> post (useragent => request => { request => $request, response => $postback } ); + #my $request = HTTP::Request::Common::POST( $pasteurl => [ %formdata ] ); + #$poe_kernel -> post (useragent => request => { request => $request, response => $postback } ); + my $ua = LWP::UserAgent->new; + $ua->env_proxy; + my $response = $ua->post( $pasteurl, \%formdata ); + print STDOUT $response->status_line, "\n"; return; } my $cmd = shift @{ $todo }; @@ -167,9 +172,8 @@ This script requires: - POE - POE::Component::Client::UserAgent - HTTP::Request::Common + POE >= 0.35 + LWP::UserAgent =head1 COMMAND LINE PARAMETERS This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |