Subject: | Patch to work in AnyEvent >= 6.01 |
Patch to work with recent AnyEvent versions is attached.
- Alex
Subject: | 0001-Store-client-handle-away-as-AnyEvent-6-fixed-the-bug.patch |
From 281b474e3149f27f3af32a24ff60ee03bd63db82 Mon Sep 17 00:00:00 2001
From: Alex Vandiver <alex@chmrr.net>
Date: Wed, 28 Mar 2012 00:01:16 -0400
Subject: [PATCH] Store client handle away, as AnyEvent 6 fixed the bug it relied on
The changelog for AnyEvent 6.01 includes:
- some read types (regex, netstring, json, storable) could
errornously keep an AE::Handle object alive on their own
(reported by Mohammad Toossi).
Previously, this bug was the only reason that the client handle did not
go out of scope. Store the handle in %state such that it continues to
read data.
---
lib/AnyEvent/HTTP/MXHR.pm | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/lib/AnyEvent/HTTP/MXHR.pm b/lib/AnyEvent/HTTP/MXHR.pm
index 949f1df..3b1b5c0 100644
--- a/lib/AnyEvent/HTTP/MXHR.pm
+++ b/lib/AnyEvent/HTTP/MXHR.pm
@@ -40,6 +40,7 @@ sub mxhr_get ($@) {
$on_error->("Connection failed") if $on_error;
return ();
}
+ $state{handle} = $handle;
my $callback; $callback = sub {
my ($handle, $data) = @_;
--
1.7.4.1