Subject: | bug in _finish_request |
On FreeBSD new Client::HTTP complaining on any request: Can't call
method "wheel" on an undefined value.
I investigated the problem and found that _finish_request is called from
poco_weeble_io_error handler (in turn poco_weeble_io_error is called
when eof is reached).
The poco_weeble_io_error handler, removes request from heap.
my $request = delete $heap->{request}->{$request_id};
But later _finish_request, tries to get it from heap in the same way:
my $request = delete $heap->{request}->{$request_id};
My fix is simple: _finish_request already having
Component::HTTP::Request as paraeter, so let just not to shadow our
parameter and
just delete request from heap.
Subject: | finish_request_fix.patch |
Index: lib/POE/Component/Client/HTTP.pm
===================================================================
--- lib/POE/Component/Client/HTTP.pm (revision 259)
+++ lib/POE/Component/Client/HTTP.pm (working copy)
@@ -723,7 +723,7 @@
# Virtually identical to _remove_request.
# TODO - Make a common sub to handle both cases?
DEBUG and warn "I/O: removing request $request_id";
- my $request = delete $heap->{request}->{$request_id};
+ $request = delete $heap->{request}->{$request_id};
if (my $wheel = $request->wheel) {
delete $heap->{wheel_to_request}->{$wheel->ID};
}