summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatias Linares <matiaslina@gmail.com>2017-04-28 11:06:47 -0300
committerMatias Linares <matiaslina@gmail.com>2017-04-28 11:06:47 -0300
commitdab77bf2edd8d7ee2a886cfb5a621a1512c87b09 (patch)
treed9ca82992a47e13dc7c2b8016fbd7e14b386c7be
parent7535d28d8ee8ba11f026320c07e019f4d1abc471 (diff)
downloadperl6-matrix-client-dab77bf2edd8d7ee2a886cfb5a621a1512c87b09.tar.gz
Remove the history cleanup for the requests.
HTTP::UserAgent fixed a memory leak for the history (https://github.com/sergot/http-useragent/commit/60c21b9672a5c377e5ffd967aaea025e47816b27) Since it's a change with the public API of the library and fixes the memory problems on a long running process, we don't need this hack anymore
-rw-r--r--META6.json2
-rw-r--r--lib/Matrix/Client/Requester.pm64
2 files changed, 1 insertions, 5 deletions
diff --git a/META6.json b/META6.json
index 6f19eba..001ebf6 100644
--- a/META6.json
+++ b/META6.json
@@ -2,7 +2,7 @@
"perl" : "6.c",
"name" : "Matrix::Client",
"license" : "Artistic-2.0",
- "version" : "0.1.0",
+ "version" : "0.1.1",
"description" : "Matrix client for Perl 6",
"tags" : [ "Net", "Matrix" ],
"depends" : [
diff --git a/lib/Matrix/Client/Requester.pm6 b/lib/Matrix/Client/Requester.pm6
index f6244e3..b13272b 100644
--- a/lib/Matrix/Client/Requester.pm6
+++ b/lib/Matrix/Client/Requester.pm6
@@ -19,7 +19,6 @@ method get(Str $path, :$media = False, *%data) {
}
my $uri = uri_encode($.base-url(:$media) ~ $q);
- $!ua.history = [];
$!ua.get($uri)
}
@@ -35,13 +34,11 @@ multi method post(Str $path, Str $json, :$media = False) {
my $req = HTTP::Request.new(POST => $.base-url(:$media) ~ $path ~ "?access_token=$!access-token",
Content-Type => 'application/json');
$req.add-content($json);
- $!ua.history = [];
$!ua.request($req)
}
method post-bin(Str $path, Buf $buf, :$content-type) {
my $req = POST($.base-url(:media) ~ $path ~ "?access_token=$!access-token", content => $buf, Content-Type => $content-type);
- $!ua.history = [];
$!ua.request($req)
}
@@ -53,7 +50,6 @@ multi method put(Str $path,Str $json) {
my $req = HTTP::Request.new(PUT => $.base-url() ~ $path ~ "?access_token=$!access-token",
Content-Type => 'application/json');
$req.add-content($json);
- $!ua.history = [];
$!ua.request($req)
}