Skip Menu |
 

This queue is for tickets about the POE-Component-Client-HTTP CPAN distribution.

Report information
The Basics
Id: 13988
Status: resolved
Priority: 0/
Queue: POE-Component-Client-HTTP

People
Owner: Nobody in particular
Requestors: tech [...] askold.net
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: (no value)
Fixed in: (no value)

Attachments


MIME-Version: 1.0
X-Mailer: MIME-tools 5.415 (Entity 5.415)
Subject: Proxy Support fixes
Content-Type: multipart/mixed; boundary="----------=_1122997170-12758-0"
Content-Length: 0
Content-Type: text/plain
Content-Disposition: inline
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: iso-8859-1
Content-Length: 90
This patch make proxy support working. There is no tests for proxy, but I will to it soon.
Content-Type: text/plain; name="proxy_support.diff"
Content-Disposition: inline; filename="proxy_support.diff"
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: iso-8859-1
Content-Length: 2349
Download proxy_support.diff
text/x-diff 2.2k
Index: Request.pm =================================================================== --- Request.pm (revision 200) +++ Request.pm (working copy) @@ -121,7 +121,8 @@ # This request qualifies for proxying. Replace the host and port # with the proxy's host and port. This comes after the Host: # header is set, so it doesn't break the request object. - ($host, $port) = $params{Proxy}->[rand @{$params{Proxy}}]; + ($host, $port) = @{$params{Proxy}->[rand @{$params{Proxy}}]}; + $using_proxy = 1; } else { @@ -516,6 +517,16 @@ return; } +sub host { shift->[REQ_HOST] } + +sub port { shift->[REQ_PORT] } + +sub scheme { + my $self = shift; + + $self->[REQ_USING_PROXY] ? 'http' : $self->[REQ_REQUEST]->uri->scheme; +} + sub DESTROY { my ($self) = @_; Index: HTTP.pm =================================================================== --- HTTP.pm (revision 200) +++ HTTP.pm (working copy) @@ -164,13 +164,13 @@ ); } - + eval { # get a connection from Client::Keepalive $heap->{cm}->allocate( - scheme => $http_request->uri->scheme, - addr => $http_request->uri->host, - port => $http_request->uri->port, + scheme => $request->scheme, + addr => $request->host, + port => $request->port, context => $request->ID, event => 'got_connect_done', @timeout, Index: RequestFactory.pm =================================================================== --- RequestFactory.pm (revision 200) +++ RequestFactory.pm (working copy) @@ -288,20 +288,19 @@ # request URI. my $proxy = $self->[FCT_PROXY]; - my $using_proxy; if (defined $proxy) { # This request qualifies for proxying. Replace the host and port # with the proxy's host and port. This comes after the Host: # header is set, so it doesn't break the request object. my $host = $http_request->uri->host; - if (not _in_no_proxy ($host, $self->[FCT_NOPROXY])) { - my $using_proxy = $proxy->[@$proxy]; - } + + undef $proxy + if _in_no_proxy ($host, $self->[FCT_NOPROXY]); } my $request = POE::Component::Client::HTTP::Request->new ( Request => $http_request, - Proxy => $using_proxy, + Proxy => $proxy, Postback => $postback, Tag => $tag, Progress => $progress_postback,
Content-Type: text/plain
Content-Disposition: inline
Content-Transfer-Encoding: binary
MIME-Version: 1.0
X-Mailer: MIME-tools 5.415 (Entity 5.415)
X-RT-Original-Encoding: iso-8859-1
Content-Length: 83
Applied as revision 203. Thank you again, and I'm looking forward to that test. :)


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.