Skip to content

Commit

Permalink
Avoid cycle in response
Browse files Browse the repository at this point in the history
The response_data handler callback attached to the response during
LWP processing contained a reference to the response itself.
  • Loading branch information
gisle committed Jul 6, 2009
1 parent 1a40ee3 commit 0d2ffc5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/LWP/UserAgent.pm
Expand Up @@ -595,8 +595,9 @@ sub parse_head {
return unless $parser;
unless ($parser->parse($_[3])) {
my $h = $parser->header;
my $r = $_[0];
for my $f ($h->header_field_names) {
$response->init_header($f, [$h->header($f)]);
$r->init_header($f, [$h->header($f)]);
}
undef($parser);
}
Expand Down

0 comments on commit 0d2ffc5

Please sign in to comment.