summaryrefslogtreecommitdiff
path: root/t/13slowleak.t
diff options
context:
space:
mode:
authorJinkun Jang <jinkun.jang@samsung.com>2013-03-12 15:16:01 +0900
committerJinkun Jang <jinkun.jang@samsung.com>2013-03-12 15:16:01 +0900
commit0034f59c7ed77eb8f8fe1ec082749d8520e3412e (patch)
tree6b318e64217938d6cd8ca074214778d2db99de84 /t/13slowleak.t
parent3555375b5b187f5eb25bc6673e2479d54f20ada3 (diff)
downloadperl-WWW-Curl-0034f59c7ed77eb8f8fe1ec082749d8520e3412e.tar.gz
perl-WWW-Curl-0034f59c7ed77eb8f8fe1ec082749d8520e3412e.tar.bz2
perl-WWW-Curl-0034f59c7ed77eb8f8fe1ec082749d8520e3412e.zip
Diffstat (limited to 't/13slowleak.t')
-rw-r--r--t/13slowleak.t43
1 files changed, 43 insertions, 0 deletions
diff --git a/t/13slowleak.t b/t/13slowleak.t
new file mode 100644
index 0000000..1bfbb21
--- /dev/null
+++ b/t/13slowleak.t
@@ -0,0 +1,43 @@
+#!perl
+
+use strict;
+use warnings;
+#use Test::More tests => 214;
+use Test::More skip_all => "Not performing slow leakage regression test";
+
+BEGIN { use_ok( 'WWW::Curl::Easy' ); }
+
+my $url = $ENV{CURL_TEST_URL} || "http://www.google.com";
+
+# There was a slow leak per curl handle init/cleanup. Hopefully fixed.
+
+foreach my $j (1..200) {
+
+# Init the curl session
+my $curl = WWW::Curl::Easy->new() or die "cannot curl";
+
+$curl->setopt(CURLOPT_NOPROGRESS, 1);
+$curl->setopt(CURLOPT_FOLLOWLOCATION, 1);
+$curl->setopt(CURLOPT_TIMEOUT, 30);
+
+open (HEAD, "+>",undef);
+WWW::Curl::Easy::setopt($curl, CURLOPT_WRITEHEADER, \*HEAD);
+open (BODY, "+>, undef);
+WWW::Curl::Easy::setopt($curl, CURLOPT_FILE, \*BODY);
+
+$curl->setopt(CURLOPT_URL, $url);
+
+my $httpcode = 0;
+
+my $retcode=$curl->perform();
+if ($retcode == 0) {
+ my bytes=$curl->getinfo(CURLINFO_SIZE_DOWNLOAD);
+ my $realurl=$curl->getinfo(CURLINFO_EFFECTIVE_URL);
+ my $httpcode=$curl->getinfo(CURLINFO_HTTP_CODE);
+} else {
+ print "not ok $retcode / ".$curl->errbuf."\n";
+}
+
+}
+
+WWW::Curl::Easy::global_cleanup; #noop