X-Git-Url: http://dxcluster.net/gitweb/gitweb.cgi?a=blobdiff_plain;f=perl%2FAsyncMsg.pm;h=95c5e8f67c974d8eace5f0e5ba9b7fbf69ef42f1;hb=af00b2713eb62cdee83a6bf184e2b410226f8be6;hp=b1875d97bb8fa9d5698e30a1f5efcfa547cee159;hpb=f643e3f3103b73c60f9a0106754e060d3ea6d707;p=spider.git diff --git a/perl/AsyncMsg.pm b/perl/AsyncMsg.pm index b1875d97..95c5e8f6 100644 --- a/perl/AsyncMsg.pm +++ b/perl/AsyncMsg.pm @@ -118,6 +118,8 @@ sub _getpost $conn->{_assort} = $sort; $conn->{csort} = 'http'; + my $data = delete $args{data}; + my $ua = Mojo::UserAgent->new; my $s; $s .= $host; @@ -132,7 +134,6 @@ sub _getpost $ua->on(start => sub { my ($ua, $tx) = @_; - my $data = delete $args{data}; while (my ($k, $v) = each %args) { dbg("AsyncMsg: attaching header $k: $v") if isdbg('async'); $tx->req->headers->header($k => $v);