From a29105ec56e7ef23d2af74d0046a46ba62ff3af2 Mon Sep 17 00:00:00 2001 From: DongHun Kwak Date: Thu, 21 Jul 2022 11:28:24 +0900 Subject: [PATCH] Imported Upstream version 6.35 --- Changes | 28 ++++- MANIFEST | 5 +- META.json | 201 +++++++++++++++++-------------- META.yml | 177 +++++++++++++++------------ Makefile.PL | 53 +++++++- cpanfile | 10 +- dist.ini | 9 ++ lib/LWP.pm | 2 +- lib/LWP/Authen/Basic.pm | 2 +- lib/LWP/Authen/Digest.pm | 2 +- lib/LWP/Authen/Ntlm.pm | 2 +- lib/LWP/ConnCache.pm | 2 +- lib/LWP/Debug.pm | 2 +- lib/LWP/Debug/TraceHTTP.pm | 2 +- lib/LWP/DebugFile.pm | 2 +- lib/LWP/MemberMixin.pm | 2 +- lib/LWP/Protocol.pm | 128 +++++++++++--------- lib/LWP/Protocol/cpan.pm | 2 +- lib/LWP/Protocol/data.pm | 2 +- lib/LWP/Protocol/file.pm | 2 +- lib/LWP/Protocol/ftp.pm | 2 +- lib/LWP/Protocol/gopher.pm | 2 +- lib/LWP/Protocol/http.pm | 2 +- lib/LWP/Protocol/loopback.pm | 2 +- lib/LWP/Protocol/mailto.pm | 2 +- lib/LWP/Protocol/nntp.pm | 2 +- lib/LWP/Protocol/nogo.pm | 2 +- lib/LWP/RobotUA.pm | 2 +- lib/LWP/Simple.pm | 2 +- lib/LWP/UserAgent.pm | 11 +- t/00-report-prereqs.dd | 23 ++-- t/leak/no_leak.t | 26 ++++ xt/author/eol.t | 1 + xt/author/minimum-version.t | 6 + xt/author/pod-spell.t | 12 ++ xt/release/changes_has_content.t | 8 +- xt/release/minimum-version.t | 8 -- 37 files changed, 452 insertions(+), 296 deletions(-) create mode 100644 t/leak/no_leak.t create mode 100644 xt/author/minimum-version.t delete mode 100644 xt/release/minimum-version.t diff --git a/Changes b/Changes index e6aa28a..10e0218 100644 --- a/Changes +++ b/Changes @@ -1,13 +1,25 @@ Change history for libwww-perl +6.35 2018-07-16 04:48:54Z + - fix file descriptor leak in LWP::Protocol (introduced in version 6.17) + that occurs for perl versions earlier than 5.18. (GH #296) + +6.34 2018-06-05 18:48:59Z + - timeout() documentation has more details about the response (thanks, + Andrew Grangaard!) + - HTTP::Status is now upgraded to 6.18 if 6.17 is installed (which had a + bug). + 6.33 2018-02-27 03:51:36Z - Fix send_te change from previous release, which was breaking LWP::Parallel::UserAgent and Test::Override::UserAgent (GH #281) (Doug Bell) 6.32 2018-02-20 19:39:20Z - - Suggest LWP::ConsoleLogger as an alternative to the deprecated LWP::Debug (GH#278) (Olaf Alders) - - add send_te configuration to disable sending the TE header (GH#126) (Doug Bell) + - Suggest LWP::ConsoleLogger as an alternative to the deprecated LWP::Debug + (GH#278) (Olaf Alders) + - add send_te configuration to disable sending the TE header (GH#126) + (Doug Bell) - Added a developer feature to the http.t tests. (GH#257) (colinnewell) 6.31 2017-12-11 01:55:53Z @@ -25,7 +37,8 @@ Change history for libwww-perl 6.28 2017-11-06 - Remove last use of Geopt::Std (Sergey Remanov) (GH #267) - - Include unmatched connect error in status string (Patrik Lundin) (GH #269) + - Include unmatched connect error in status string (Patrik Lundin) (GH + #269) - Fix insecure open FILEHANDLE,EXPR (Takumi Akiyama) (GH #270) 6.27 2017-09-21 @@ -97,13 +110,16 @@ Change history for libwww-perl - Updated test suite to use strict/warnings and Test::More (PR#88) - Additional tests for UserAgent coverage (PR#79) - Cleaned up documentation formatting and fixed several typos (PR#87, PR#93) - - Stop promoting use of HTTP::Cookies and instead use HTTP::CookieJar::LWP (PR#102) + - Stop promoting use of HTTP::Cookies and instead use HTTP::CookieJar::LWP + (PR#102) - Added some new documentation to UserAgent and tutorial (PR#68) - Allow default header to carry over when using ->post() in UA (PR#100) 6.15 2015-12-15 - - tests now use localhost rather than a net-accessible address (PR#76, RT#94959) - - fixed some tests to do what they intended (regex rather than boolean checks) (from PR#28) + - tests now use localhost rather than a net-accessible address (PR#76, + RT#94959) + - fixed some tests to do what they intended (regex rather than boolean + checks) (from PR#28) - conversion of some tests from Test.pm to Test::More (from PR#29) - use File::Temp for randomized tempdir (PR#53) diff --git a/MANIFEST b/MANIFEST index 1cdebcd..244b9b5 100644 --- a/MANIFEST +++ b/MANIFEST @@ -1,4 +1,4 @@ -# This file was automatically generated by Dist::Zilla::Plugin::Manifest v6.011. +# This file was automatically generated by Dist::Zilla::Plugin::Manifest v6.012. CONTRIBUTING.md Changes LICENSE @@ -48,6 +48,7 @@ t/base/proxy.t t/base/simple.t t/base/ua.t t/base/ua_handlers.t +t/leak/no_leak.t t/local/autoload-get.t t/local/autoload.t t/local/get.t @@ -69,6 +70,7 @@ xt/author/live/jigsaw/neg-get.t xt/author/live/jigsaw/neg.t xt/author/live/jigsaw/te.t xt/author/live/online.t +xt/author/minimum-version.t xt/author/misc/dbmrobot xt/author/misc/get-callback xt/author/misc/get-file @@ -93,4 +95,3 @@ xt/author/pod-syntax.t xt/author/portability.t xt/author/test-version.t xt/release/changes_has_content.t -xt/release/minimum-version.t diff --git a/META.json b/META.json index 7ce0677..b48e0ca 100644 --- a/META.json +++ b/META.json @@ -3,8 +3,8 @@ "author" : [ "Gisle Aas " ], - "dynamic_config" : 0, - "generated_by" : "Dist::Zilla version 6.011, CPAN::Meta::Converter version 2.150010", + "dynamic_config" : 1, + "generated_by" : "Dist::Zilla version 6.012, CPAN::Meta::Converter version 2.150010", "license" : [ "perl_5" ], @@ -22,38 +22,32 @@ "prereqs" : { "configure" : { "requires" : { + "CPAN::Meta::Requirements" : "2.120620", "ExtUtils::MakeMaker" : "0", "File::Copy" : "0", - "Getopt::Long" : "0" - }, - "suggests" : { - "JSON::PP" : "2.27300" + "Getopt::Long" : "0", + "Module::Metadata" : "0" } }, "develop" : { "recommends" : { - "Dist::Zilla::PluginBundle::Git::VersionManager" : "0.005" + "Dist::Zilla::PluginBundle::Git::VersionManager" : "0.007" }, "requires" : { + "Authen::NTLM" : "1.02", "File::Spec" : "0", "IO::Handle" : "0", "IPC::Open3" : "0", "Pod::Coverage::TrustPod" : "0", - "Test::CPAN::Changes" : "0.4", - "Test::CPAN::Meta" : "0", - "Test::CheckManifest" : "1.29", "Test::EOL" : "0", - "Test::Kwalitee" : "1.22", "Test::MinimumVersion" : "0", "Test::Mojibake" : "0", "Test::More" : "0.94", "Test::Pod" : "1.41", "Test::Pod::Coverage" : "1.08", - "Test::Pod::Spelling::CommonMistakes" : "1.000", "Test::Portability::Files" : "0", "Test::Spelling" : "0.12", - "Test::Version" : "1", - "Try::Tiny" : "0.24" + "Test::Version" : "1" } }, "runtime" : { @@ -90,13 +84,15 @@ }, "suggests" : { "Authen::NTLM" : "1.02", + "Data::Dump" : "1.13", "IO::Socket::INET" : "0", "LWP::Protocol::https" : "6.02" } }, "test" : { "recommends" : { - "CPAN::Meta" : "2.120900" + "CPAN::Meta" : "2.120900", + "Test::LeakTrace" : "0" }, "requires" : { "ExtUtils::MakeMaker" : "0", @@ -104,6 +100,7 @@ "FindBin" : "0", "Test::Fatal" : "0", "Test::More" : "0", + "Test::Needs" : "0", "Test::RequiresInternet" : "0" } } @@ -111,96 +108,96 @@ "provides" : { "LWP" : { "file" : "lib/LWP.pm", - "version" : "6.33" + "version" : "6.35" }, "LWP::Authen::Basic" : { "file" : "lib/LWP/Authen/Basic.pm", - "version" : "6.33" + "version" : "6.35" }, "LWP::Authen::Digest" : { "file" : "lib/LWP/Authen/Digest.pm", - "version" : "6.33" + "version" : "6.35" }, "LWP::Authen::Ntlm" : { "file" : "lib/LWP/Authen/Ntlm.pm", - "version" : "6.33" + "version" : "6.35" }, "LWP::ConnCache" : { "file" : "lib/LWP/ConnCache.pm", - "version" : "6.33" + "version" : "6.35" }, "LWP::Debug" : { "file" : "lib/LWP/Debug.pm", - "version" : "6.33", + "version" : "6.35", "x_deprecated" : 1 }, "LWP::Debug::TraceHTTP" : { "file" : "lib/LWP/Debug/TraceHTTP.pm", - "version" : "6.33" + "version" : "6.35" }, "LWP::DebugFile" : { "file" : "lib/LWP/DebugFile.pm", - "version" : "6.33" + "version" : "6.35" }, "LWP::MemberMixin" : { "file" : "lib/LWP/MemberMixin.pm", - "version" : "6.33" + "version" : "6.35" }, "LWP::Protocol" : { "file" : "lib/LWP/Protocol.pm", - "version" : "6.33" + "version" : "6.35" }, "LWP::Protocol::cpan" : { "file" : "lib/LWP/Protocol/cpan.pm", - "version" : "6.33" + "version" : "6.35" }, "LWP::Protocol::data" : { "file" : "lib/LWP/Protocol/data.pm", - "version" : "6.33" + "version" : "6.35" }, "LWP::Protocol::file" : { "file" : "lib/LWP/Protocol/file.pm", - "version" : "6.33" + "version" : "6.35" }, "LWP::Protocol::ftp" : { "file" : "lib/LWP/Protocol/ftp.pm", - "version" : "6.33" + "version" : "6.35" }, "LWP::Protocol::gopher" : { "file" : "lib/LWP/Protocol/gopher.pm", - "version" : "6.33" + "version" : "6.35" }, "LWP::Protocol::http" : { "file" : "lib/LWP/Protocol/http.pm", - "version" : "6.33" + "version" : "6.35" }, "LWP::Protocol::loopback" : { "file" : "lib/LWP/Protocol/loopback.pm", - "version" : "6.33" + "version" : "6.35" }, "LWP::Protocol::mailto" : { "file" : "lib/LWP/Protocol/mailto.pm", - "version" : "6.33" + "version" : "6.35" }, "LWP::Protocol::nntp" : { "file" : "lib/LWP/Protocol/nntp.pm", - "version" : "6.33" + "version" : "6.35" }, "LWP::Protocol::nogo" : { "file" : "lib/LWP/Protocol/nogo.pm", - "version" : "6.33" + "version" : "6.35" }, "LWP::RobotUA" : { "file" : "lib/LWP/RobotUA.pm", - "version" : "6.33" + "version" : "6.35" }, "LWP::Simple" : { "file" : "lib/LWP/Simple.pm", - "version" : "6.33" + "version" : "6.35" }, "LWP::UserAgent" : { "file" : "lib/LWP/UserAgent.pm", - "version" : "6.33" + "version" : "6.35" } }, "release_status" : "stable", @@ -217,10 +214,10 @@ "x_IRC" : "irc://irc.perl.org/#lwp", "x_MailingList" : "mailto:libwww@perl.org" }, - "version" : "6.33", + "version" : "6.35", "x_Dist_Zilla" : { "perl" : { - "version" : "5.026001" + "version" : "5.028000" }, "plugins" : [ { @@ -244,12 +241,12 @@ } }, "name" : "Git::GatherDir", - "version" : "2.043" + "version" : "2.045" }, { "class" : "Dist::Zilla::Plugin::MetaConfig", "name" : "MetaConfig", - "version" : "6.011" + "version" : "6.012" }, { "class" : "Dist::Zilla::Plugin::MetaProvides::Package", @@ -259,7 +256,7 @@ { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : "MetaProvides::Package/AUTOVIV/:InstallModulesPM", - "version" : "6.011" + "version" : "6.012" } ], "include_underscores" : 0 @@ -272,7 +269,7 @@ }, "Dist::Zilla::Role::ModuleMetadata" : { "Module::Metadata" : "1.000033", - "version" : "0.004" + "version" : "0.006" } }, "name" : "MetaProvides::Package", @@ -281,22 +278,22 @@ { "class" : "Dist::Zilla::Plugin::MetaNoIndex", "name" : "MetaNoIndex", - "version" : "6.011" + "version" : "6.012" }, { "class" : "Dist::Zilla::Plugin::MetaYAML", "name" : "MetaYAML", - "version" : "6.011" + "version" : "6.012" }, { "class" : "Dist::Zilla::Plugin::MetaJSON", "name" : "MetaJSON", - "version" : "6.011" + "version" : "6.012" }, { "class" : "Dist::Zilla::Plugin::MetaResources", "name" : "MetaResources", - "version" : "6.011" + "version" : "6.012" }, { "class" : "Dist::Zilla::Plugin::Deprecated", @@ -315,7 +312,7 @@ "class" : "Dist::Zilla::Plugin::Git::Contributors", "config" : { "Dist::Zilla::Plugin::Git::Contributors" : { - "git_version" : "2.16.1", + "git_version" : "2.18.0", "include_authors" : 0, "include_releaser" : 1, "order_by" : "name", @@ -323,12 +320,12 @@ } }, "name" : "Git::Contributors", - "version" : "0.032" + "version" : "0.034" }, { "class" : "Dist::Zilla::Plugin::GithubMeta", "name" : "GithubMeta", - "version" : "0.54" + "version" : "0.58" }, { "class" : "Dist::Zilla::Plugin::Authority", @@ -338,37 +335,47 @@ { "class" : "Dist::Zilla::Plugin::Manifest", "name" : "Manifest", - "version" : "6.011" + "version" : "6.012" }, { "class" : "Dist::Zilla::Plugin::License", "name" : "License", - "version" : "6.011" + "version" : "6.012" }, { "class" : "Dist::Zilla::Plugin::ExecDir", "name" : "ExecDir", - "version" : "6.011" + "version" : "6.012" }, { "class" : "Dist::Zilla::Plugin::Prereqs::FromCPANfile", "name" : "Prereqs::FromCPANfile", "version" : "0.08" }, + { + "class" : "Dist::Zilla::Plugin::DynamicPrereqs", + "config" : { + "Dist::Zilla::Role::ModuleMetadata" : { + "Module::Metadata" : "1.000033", + "version" : "0.006" + } + }, + "name" : "DynamicPrereqs", + "version" : "0.034" + }, { "class" : "Dist::Zilla::Plugin::MakeMaker::Awesome", "config" : { "Dist::Zilla::Plugin::MakeMaker" : { "make_path" : "make", - "version" : "6.011" + "version" : "6.012" }, "Dist::Zilla::Role::TestRunner" : { - "default_jobs" : 1, - "version" : "6.011" + "version" : "6.012" } }, "name" : "MakeMaker::Awesome", - "version" : "0.41" + "version" : "0.46" }, { "class" : "Dist::Zilla::Plugin::MojibakeTests", @@ -439,15 +446,20 @@ "name" : "Test::ChangesHasContent", "version" : "0.011" }, + { + "class" : "Dist::Zilla::Plugin::Substitute", + "name" : "Substitute", + "version" : "0.006" + }, { "class" : "Dist::Zilla::Plugin::Test::MinimumVersion", "name" : "Test::MinimumVersion", - "version" : "2.000007" + "version" : "2.000008" }, { "class" : "Dist::Zilla::Plugin::PodSyntaxTests", "name" : "PodSyntaxTests", - "version" : "6.011" + "version" : "6.012" }, { "class" : "Dist::Zilla::Plugin::Test::Pod::Coverage::Configurable", @@ -598,12 +610,12 @@ "changelog" : "Changes" }, "Dist::Zilla::Role::Git::Repo" : { - "git_version" : "2.16.1", + "git_version" : "2.18.0", "repo_root" : "." } }, "name" : "Git::Check", - "version" : "2.043" + "version" : "2.045" }, { "class" : "Dist::Zilla::Plugin::CheckStrictVersion", @@ -633,12 +645,12 @@ { "class" : "Dist::Zilla::Plugin::TestRelease", "name" : "TestRelease", - "version" : "6.011" + "version" : "6.012" }, { "class" : "Dist::Zilla::Plugin::UploadToCPAN", "name" : "UploadToCPAN", - "version" : "6.011" + "version" : "6.012" }, { "class" : "Dist::Zilla::Plugin::ReadmeAnyFromPod", @@ -662,7 +674,7 @@ } }, "name" : "CopyFilesFromRelease", - "version" : "0.006" + "version" : "0.007" }, { "class" : "Dist::Zilla::Plugin::Prereqs", @@ -673,7 +685,7 @@ } }, "name" : "@Git::VersionManager/pluginbundle version", - "version" : "6.011" + "version" : "6.012" }, { "class" : "Dist::Zilla::Plugin::RewriteVersion::Transitional", @@ -695,7 +707,7 @@ { "class" : "Dist::Zilla::Plugin::MetaProvides::Update", "name" : "@Git::VersionManager/MetaProvides::Update", - "version" : "0.005" + "version" : "0.007" }, { "class" : "Dist::Zilla::Plugin::CopyFilesFromRelease", @@ -708,7 +720,7 @@ } }, "name" : "@Git::VersionManager/CopyFilesFromRelease", - "version" : "0.006" + "version" : "0.007" }, { "class" : "Dist::Zilla::Plugin::Git::Commit", @@ -728,7 +740,7 @@ "changelog" : "Changes" }, "Dist::Zilla::Role::Git::Repo" : { - "git_version" : "2.16.1", + "git_version" : "2.18.0", "repo_root" : "." }, "Dist::Zilla::Role::Git::StringFormatter" : { @@ -736,7 +748,7 @@ } }, "name" : "@Git::VersionManager/release snapshot", - "version" : "2.043" + "version" : "2.045" }, { "class" : "Dist::Zilla::Plugin::Git::Tag", @@ -745,12 +757,12 @@ "branch" : null, "changelog" : "Changes", "signed" : 0, - "tag" : "v6.33", + "tag" : "v6.35", "tag_format" : "v%v", "tag_message" : "v%v" }, "Dist::Zilla::Role::Git::Repo" : { - "git_version" : "2.16.1", + "git_version" : "2.18.0", "repo_root" : "." }, "Dist::Zilla::Role::Git::StringFormatter" : { @@ -758,7 +770,7 @@ } }, "name" : "@Git::VersionManager/Git::Tag", - "version" : "2.043" + "version" : "2.045" }, { "class" : "Dist::Zilla::Plugin::BumpVersionAfterRelease::Transitional", @@ -779,7 +791,7 @@ { "class" : "Dist::Zilla::Plugin::NextRelease", "name" : "@Git::VersionManager/NextRelease", - "version" : "6.011" + "version" : "6.012" }, { "class" : "Dist::Zilla::Plugin::Git::Commit", @@ -800,7 +812,7 @@ "changelog" : "Changes" }, "Dist::Zilla::Role::Git::Repo" : { - "git_version" : "2.16.1", + "git_version" : "2.18.0", "repo_root" : "." }, "Dist::Zilla::Role::Git::StringFormatter" : { @@ -808,7 +820,7 @@ } }, "name" : "@Git::VersionManager/post-release commit", - "version" : "2.043" + "version" : "2.045" }, { "class" : "Dist::Zilla::Plugin::Git::Push", @@ -820,72 +832,72 @@ "remotes_must_exist" : 1 }, "Dist::Zilla::Role::Git::Repo" : { - "git_version" : "2.16.1", + "git_version" : "2.18.0", "repo_root" : "." } }, "name" : "Git::Push", - "version" : "2.043" + "version" : "2.045" }, { "class" : "Dist::Zilla::Plugin::ConfirmRelease", "name" : "ConfirmRelease", - "version" : "6.011" + "version" : "6.012" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":InstallModules", - "version" : "6.011" + "version" : "6.012" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":IncModules", - "version" : "6.011" + "version" : "6.012" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":TestFiles", - "version" : "6.011" + "version" : "6.012" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":ExtraTestFiles", - "version" : "6.011" + "version" : "6.012" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":ExecFiles", - "version" : "6.011" + "version" : "6.012" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":PerlExecFiles", - "version" : "6.011" + "version" : "6.012" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":ShareFiles", - "version" : "6.011" + "version" : "6.012" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":MainModule", - "version" : "6.011" + "version" : "6.012" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":AllFiles", - "version" : "6.011" + "version" : "6.012" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":NoFiles", - "version" : "6.011" + "version" : "6.012" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : "MetaProvides::Package/AUTOVIV/:InstallModulesPM", - "version" : "6.011" + "version" : "6.012" } ], "zilla" : { @@ -893,7 +905,7 @@ "config" : { "is_trial" : 0 }, - "version" : "6.011" + "version" : "6.012" } }, "x_authority" : "cpan:LWWWP", @@ -904,6 +916,8 @@ "Alex Kapranoff ", "amire80 ", "Andreas J. Koenig ", + "Andrew Grangaard ", + "Anirvan Chatterjee ", "BGMNT ", "Bill Mann ", "Bron Gondwana ", @@ -917,6 +931,7 @@ "DAVIDRW ", "David Standish ", "David Steinbrunner ", + "Desmond Daignault ", "Doug Bell ", "Fabian Zeindler ", "Father Chrysostomos ", @@ -964,6 +979,7 @@ "sasao ", "Sean M. Burke ", "Sergey Romanov ", + "Shoichi Kaji ", "Slaven Rezic ", "Spiros Denaxas ", "Steffen Ullrich ", @@ -984,6 +1000,7 @@ "Yury Zavarin ", "Zefram " ], - "x_serialization_backend" : "Cpanel::JSON::XS version 3.0239" + "x_generated_by_perl" : "v5.28.0", + "x_serialization_backend" : "Cpanel::JSON::XS version 4.04" } diff --git a/META.yml b/META.yml index 7d7fd6a..2b7b2b6 100644 --- a/META.yml +++ b/META.yml @@ -8,13 +8,16 @@ build_requires: FindBin: '0' Test::Fatal: '0' Test::More: '0' + Test::Needs: '0' Test::RequiresInternet: '0' configure_requires: + CPAN::Meta::Requirements: '2.120620' ExtUtils::MakeMaker: '0' File::Copy: '0' Getopt::Long: '0' -dynamic_config: 0 -generated_by: 'Dist::Zilla version 6.011, CPAN::Meta::Converter version 2.150010' + Module::Metadata: '0' +dynamic_config: 1 +generated_by: 'Dist::Zilla version 6.012, CPAN::Meta::Converter version 2.150010' license: perl meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html @@ -27,74 +30,74 @@ no_index: provides: LWP: file: lib/LWP.pm - version: '6.33' + version: '6.35' LWP::Authen::Basic: file: lib/LWP/Authen/Basic.pm - version: '6.33' + version: '6.35' LWP::Authen::Digest: file: lib/LWP/Authen/Digest.pm - version: '6.33' + version: '6.35' LWP::Authen::Ntlm: file: lib/LWP/Authen/Ntlm.pm - version: '6.33' + version: '6.35' LWP::ConnCache: file: lib/LWP/ConnCache.pm - version: '6.33' + version: '6.35' LWP::Debug: file: lib/LWP/Debug.pm - version: '6.33' + version: '6.35' x_deprecated: 1 LWP::Debug::TraceHTTP: file: lib/LWP/Debug/TraceHTTP.pm - version: '6.33' + version: '6.35' LWP::DebugFile: file: lib/LWP/DebugFile.pm - version: '6.33' + version: '6.35' LWP::MemberMixin: file: lib/LWP/MemberMixin.pm - version: '6.33' + version: '6.35' LWP::Protocol: file: lib/LWP/Protocol.pm - version: '6.33' + version: '6.35' LWP::Protocol::cpan: file: lib/LWP/Protocol/cpan.pm - version: '6.33' + version: '6.35' LWP::Protocol::data: file: lib/LWP/Protocol/data.pm - version: '6.33' + version: '6.35' LWP::Protocol::file: file: lib/LWP/Protocol/file.pm - version: '6.33' + version: '6.35' LWP::Protocol::ftp: file: lib/LWP/Protocol/ftp.pm - version: '6.33' + version: '6.35' LWP::Protocol::gopher: file: lib/LWP/Protocol/gopher.pm - version: '6.33' + version: '6.35' LWP::Protocol::http: file: lib/LWP/Protocol/http.pm - version: '6.33' + version: '6.35' LWP::Protocol::loopback: file: lib/LWP/Protocol/loopback.pm - version: '6.33' + version: '6.35' LWP::Protocol::mailto: file: lib/LWP/Protocol/mailto.pm - version: '6.33' + version: '6.35' LWP::Protocol::nntp: file: lib/LWP/Protocol/nntp.pm - version: '6.33' + version: '6.35' LWP::Protocol::nogo: file: lib/LWP/Protocol/nogo.pm - version: '6.33' + version: '6.35' LWP::RobotUA: file: lib/LWP/RobotUA.pm - version: '6.33' + version: '6.35' LWP::Simple: file: lib/LWP/Simple.pm - version: '6.33' + version: '6.35' LWP::UserAgent: file: lib/LWP/UserAgent.pm - version: '6.33' + version: '6.35' requires: Digest::MD5: '0' Encode: '2.12' @@ -131,10 +134,10 @@ resources: bugtracker: https://github.com/libwww-perl/libwww-perl/issues homepage: https://github.com/libwww-perl/libwww-perl repository: https://github.com/libwww-perl/libwww-perl.git -version: '6.33' +version: '6.35' x_Dist_Zilla: perl: - version: '5.026001' + version: '5.028000' plugins: - class: Dist::Zilla::Plugin::Git::GatherDir @@ -153,11 +156,11 @@ x_Dist_Zilla: Dist::Zilla::Plugin::Git::GatherDir: include_untracked: 0 name: Git::GatherDir - version: '2.043' + version: '2.045' - class: Dist::Zilla::Plugin::MetaConfig name: MetaConfig - version: '6.011' + version: '6.012' - class: Dist::Zilla::Plugin::MetaProvides::Package config: @@ -166,7 +169,7 @@ x_Dist_Zilla: - class: Dist::Zilla::Plugin::FinderCode name: MetaProvides::Package/AUTOVIV/:InstallModulesPM - version: '6.011' + version: '6.012' include_underscores: 0 Dist::Zilla::Role::MetaProvider::Provider: $Dist::Zilla::Role::MetaProvider::Provider::VERSION: '2.002004' @@ -175,25 +178,25 @@ x_Dist_Zilla: meta_noindex: '1' Dist::Zilla::Role::ModuleMetadata: Module::Metadata: '1.000033' - version: '0.004' + version: '0.006' name: MetaProvides::Package version: '2.004003' - class: Dist::Zilla::Plugin::MetaNoIndex name: MetaNoIndex - version: '6.011' + version: '6.012' - class: Dist::Zilla::Plugin::MetaYAML name: MetaYAML - version: '6.011' + version: '6.012' - class: Dist::Zilla::Plugin::MetaJSON name: MetaJSON - version: '6.011' + version: '6.012' - class: Dist::Zilla::Plugin::MetaResources name: MetaResources - version: '6.011' + version: '6.012' - class: Dist::Zilla::Plugin::Deprecated config: @@ -207,17 +210,17 @@ x_Dist_Zilla: class: Dist::Zilla::Plugin::Git::Contributors config: Dist::Zilla::Plugin::Git::Contributors: - git_version: 2.16.1 + git_version: 2.18.0 include_authors: 0 include_releaser: 1 order_by: name paths: [] name: Git::Contributors - version: '0.032' + version: '0.034' - class: Dist::Zilla::Plugin::GithubMeta name: GithubMeta - version: '0.54' + version: '0.58' - class: Dist::Zilla::Plugin::Authority name: Authority @@ -225,30 +228,37 @@ x_Dist_Zilla: - class: Dist::Zilla::Plugin::Manifest name: Manifest - version: '6.011' + version: '6.012' - class: Dist::Zilla::Plugin::License name: License - version: '6.011' + version: '6.012' - class: Dist::Zilla::Plugin::ExecDir name: ExecDir - version: '6.011' + version: '6.012' - class: Dist::Zilla::Plugin::Prereqs::FromCPANfile name: Prereqs::FromCPANfile version: '0.08' + - + class: Dist::Zilla::Plugin::DynamicPrereqs + config: + Dist::Zilla::Role::ModuleMetadata: + Module::Metadata: '1.000033' + version: '0.006' + name: DynamicPrereqs + version: '0.034' - class: Dist::Zilla::Plugin::MakeMaker::Awesome config: Dist::Zilla::Plugin::MakeMaker: make_path: make - version: '6.011' + version: '6.012' Dist::Zilla::Role::TestRunner: - default_jobs: 1 - version: '6.011' + version: '6.012' name: MakeMaker::Awesome - version: '0.41' + version: '0.46' - class: Dist::Zilla::Plugin::MojibakeTests name: MojibakeTests @@ -302,14 +312,18 @@ x_Dist_Zilla: class: Dist::Zilla::Plugin::Test::ChangesHasContent name: Test::ChangesHasContent version: '0.011' + - + class: Dist::Zilla::Plugin::Substitute + name: Substitute + version: '0.006' - class: Dist::Zilla::Plugin::Test::MinimumVersion name: Test::MinimumVersion - version: '2.000007' + version: '2.000008' - class: Dist::Zilla::Plugin::PodSyntaxTests name: PodSyntaxTests - version: '6.011' + version: '6.012' - class: Dist::Zilla::Plugin::Test::Pod::Coverage::Configurable name: Test::Pod::Coverage::Configurable @@ -451,10 +465,10 @@ x_Dist_Zilla: allow_dirty_match: [] changelog: Changes Dist::Zilla::Role::Git::Repo: - git_version: 2.16.1 + git_version: 2.18.0 repo_root: . name: Git::Check - version: '2.043' + version: '2.045' - class: Dist::Zilla::Plugin::CheckStrictVersion name: CheckStrictVersion @@ -477,11 +491,11 @@ x_Dist_Zilla: - class: Dist::Zilla::Plugin::TestRelease name: TestRelease - version: '6.011' + version: '6.012' - class: Dist::Zilla::Plugin::UploadToCPAN name: UploadToCPAN - version: '6.011' + version: '6.012' - class: Dist::Zilla::Plugin::ReadmeAnyFromPod config: @@ -498,7 +512,7 @@ x_Dist_Zilla: - META.json match: [] name: CopyFilesFromRelease - version: '0.006' + version: '0.007' - class: Dist::Zilla::Plugin::Prereqs config: @@ -506,7 +520,7 @@ x_Dist_Zilla: phase: develop type: recommends name: '@Git::VersionManager/pluginbundle version' - version: '6.011' + version: '6.012' - class: Dist::Zilla::Plugin::RewriteVersion::Transitional config: @@ -523,7 +537,7 @@ x_Dist_Zilla: - class: Dist::Zilla::Plugin::MetaProvides::Update name: '@Git::VersionManager/MetaProvides::Update' - version: '0.005' + version: '0.007' - class: Dist::Zilla::Plugin::CopyFilesFromRelease config: @@ -532,7 +546,7 @@ x_Dist_Zilla: - Changes match: [] name: '@Git::VersionManager/CopyFilesFromRelease' - version: '0.006' + version: '0.007' - class: Dist::Zilla::Plugin::Git::Commit config: @@ -548,12 +562,12 @@ x_Dist_Zilla: allow_dirty_match: [] changelog: Changes Dist::Zilla::Role::Git::Repo: - git_version: 2.16.1 + git_version: 2.18.0 repo_root: . Dist::Zilla::Role::Git::StringFormatter: time_zone: local name: '@Git::VersionManager/release snapshot' - version: '2.043' + version: '2.045' - class: Dist::Zilla::Plugin::Git::Tag config: @@ -561,16 +575,16 @@ x_Dist_Zilla: branch: ~ changelog: Changes signed: 0 - tag: v6.33 + tag: v6.35 tag_format: v%v tag_message: v%v Dist::Zilla::Role::Git::Repo: - git_version: 2.16.1 + git_version: 2.18.0 repo_root: . Dist::Zilla::Role::Git::StringFormatter: time_zone: local name: '@Git::VersionManager/Git::Tag' - version: '2.043' + version: '2.045' - class: Dist::Zilla::Plugin::BumpVersionAfterRelease::Transitional config: @@ -586,7 +600,7 @@ x_Dist_Zilla: - class: Dist::Zilla::Plugin::NextRelease name: '@Git::VersionManager/NextRelease' - version: '6.011' + version: '6.012' - class: Dist::Zilla::Plugin::Git::Commit config: @@ -602,12 +616,12 @@ x_Dist_Zilla: - (?^:^lib/.*\.pm$) changelog: Changes Dist::Zilla::Role::Git::Repo: - git_version: 2.16.1 + git_version: 2.18.0 repo_root: . Dist::Zilla::Role::Git::StringFormatter: time_zone: local name: '@Git::VersionManager/post-release commit' - version: '2.043' + version: '2.045' - class: Dist::Zilla::Plugin::Git::Push config: @@ -616,63 +630,63 @@ x_Dist_Zilla: - origin remotes_must_exist: 1 Dist::Zilla::Role::Git::Repo: - git_version: 2.16.1 + git_version: 2.18.0 repo_root: . name: Git::Push - version: '2.043' + version: '2.045' - class: Dist::Zilla::Plugin::ConfirmRelease name: ConfirmRelease - version: '6.011' + version: '6.012' - class: Dist::Zilla::Plugin::FinderCode name: ':InstallModules' - version: '6.011' + version: '6.012' - class: Dist::Zilla::Plugin::FinderCode name: ':IncModules' - version: '6.011' + version: '6.012' - class: Dist::Zilla::Plugin::FinderCode name: ':TestFiles' - version: '6.011' + version: '6.012' - class: Dist::Zilla::Plugin::FinderCode name: ':ExtraTestFiles' - version: '6.011' + version: '6.012' - class: Dist::Zilla::Plugin::FinderCode name: ':ExecFiles' - version: '6.011' + version: '6.012' - class: Dist::Zilla::Plugin::FinderCode name: ':PerlExecFiles' - version: '6.011' + version: '6.012' - class: Dist::Zilla::Plugin::FinderCode name: ':ShareFiles' - version: '6.011' + version: '6.012' - class: Dist::Zilla::Plugin::FinderCode name: ':MainModule' - version: '6.011' + version: '6.012' - class: Dist::Zilla::Plugin::FinderCode name: ':AllFiles' - version: '6.011' + version: '6.012' - class: Dist::Zilla::Plugin::FinderCode name: ':NoFiles' - version: '6.011' + version: '6.012' - class: Dist::Zilla::Plugin::FinderCode name: MetaProvides::Package/AUTOVIV/:InstallModulesPM - version: '6.011' + version: '6.012' zilla: class: Dist::Zilla::Dist::Builder config: is_trial: '0' - version: '6.011' + version: '6.012' x_authority: cpan:LWWWP x_contributors: - 'Adam Kennedy ' @@ -681,6 +695,8 @@ x_contributors: - 'Alex Kapranoff ' - 'amire80 ' - 'Andreas J. Koenig ' + - 'Andrew Grangaard ' + - 'Anirvan Chatterjee ' - 'BGMNT ' - 'Bill Mann ' - 'Bron Gondwana ' @@ -694,6 +710,7 @@ x_contributors: - 'DAVIDRW ' - 'David Standish ' - 'David Steinbrunner ' + - 'Desmond Daignault ' - 'Doug Bell ' - 'Fabian Zeindler ' - 'Father Chrysostomos ' @@ -741,6 +758,7 @@ x_contributors: - 'sasao ' - 'Sean M. Burke ' - 'Sergey Romanov ' + - 'Shoichi Kaji ' - 'Slaven Rezic ' - 'Spiros Denaxas ' - 'Steffen Ullrich ' @@ -760,4 +778,5 @@ x_contributors: - 'Yuri Karaban ' - 'Yury Zavarin ' - 'Zefram ' -x_serialization_backend: 'YAML::Tiny version 1.70' +x_generated_by_perl: v5.28.0 +x_serialization_backend: 'YAML::Tiny version 1.73' diff --git a/Makefile.PL b/Makefile.PL index 5739a0b..8a3dd18 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -1,5 +1,5 @@ # This Makefile.PL for libwww-perl was generated by -# Dist::Zilla::Plugin::MakeMaker::Awesome 0.41. +# Dist::Zilla::Plugin::MakeMaker::Awesome 0.46. # Don't edit it but the dist.ini and plugins used to construct it. use strict; @@ -31,9 +31,11 @@ my %WriteMakefileArgs = ( "ABSTRACT" => "The World-Wide Web library for Perl", "AUTHOR" => "Gisle Aas ", "CONFIGURE_REQUIRES" => { + "CPAN::Meta::Requirements" => "2.120620", "ExtUtils::MakeMaker" => 0, "File::Copy" => 0, - "Getopt::Long" => 0 + "Getopt::Long" => 0, + "Module::Metadata" => 0 }, "DISTNAME" => "libwww-perl", "EXE_FILES" => [ @@ -81,11 +83,12 @@ my %WriteMakefileArgs = ( "FindBin" => 0, "Test::Fatal" => 0, "Test::More" => 0, + "Test::Needs" => 0, "Test::RequiresInternet" => 0 }, - "VERSION" => "6.33", + "VERSION" => "6.35", "test" => { - "TESTS" => "t/*.t t/base/*.t t/base/protocols/*.t t/local/*.t t/robot/*.t" + "TESTS" => "t/*.t t/base/*.t t/base/protocols/*.t t/leak/*.t t/local/*.t t/robot/*.t" } ); @@ -121,6 +124,7 @@ my %FallbackPrereqs = ( "Scalar::Util" => 0, "Test::Fatal" => 0, "Test::More" => 0, + "Test::Needs" => 0, "Test::RequiresInternet" => 0, "Try::Tiny" => 0, "URI" => "1.10", @@ -131,7 +135,10 @@ my %FallbackPrereqs = ( "warnings" => 0 ); -unless ( eval { ExtUtils::MakeMaker->VERSION(6.63_03) } ) { +# inserted by Dist::Zilla::Plugin::DynamicPrereqs 0.034 +requires('HTTP::Status', '6.18') if has_module('HTTP::Status', '6.17'); + +unless ( eval { ExtUtils::MakeMaker->VERSION('6.63_03') } ) { delete $WriteMakefileArgs{TEST_REQUIRES}; delete $WriteMakefileArgs{BUILD_REQUIRES}; $WriteMakefileArgs{PREREQ_PM} = \%FallbackPrereqs; @@ -141,3 +148,39 @@ delete $WriteMakefileArgs{CONFIGURE_REQUIRES} unless eval { ExtUtils::MakeMaker->VERSION(6.52) }; WriteMakefile(%WriteMakefileArgs); + +# inserted by Dist::Zilla::Plugin::DynamicPrereqs 0.034 +sub _add_prereq { + my ($mm_key, $module, $version_or_range) = @_; + $version_or_range ||= 0; + warn "$module already exists in $mm_key (at version $WriteMakefileArgs{$mm_key}{$module}) -- need to do a sane metamerge!" + if exists $WriteMakefileArgs{$mm_key}{$module} + and $WriteMakefileArgs{$mm_key}{$module} ne '0' + and $WriteMakefileArgs{$mm_key}{$module} ne $version_or_range; + warn "$module already exists in FallbackPrereqs (at version $WriteMakefileArgs{$mm_key}{$module}) -- need to do a sane metamerge!" + if exists $FallbackPrereqs{$module} and $FallbackPrereqs{$module} ne '0' + and $FallbackPrereqs{$module} ne $version_or_range; + $WriteMakefileArgs{$mm_key}{$module} = $FallbackPrereqs{$module} = $version_or_range; + return; +} + +sub has_module { + my ($module, $version_or_range) = @_; + require Module::Metadata; + my $mmd = Module::Metadata->new_from_module($module); + return undef if not $mmd; + return $mmd->version($module) if not defined $version_or_range; + + require CPAN::Meta::Requirements; + my $req = CPAN::Meta::Requirements->new; + $req->add_string_requirement($module => $version_or_range); + return 1 if $req->accepts_module($module => $mmd->version($module)); + return 0; +} + +sub requires { goto &runtime_requires } + +sub runtime_requires { + my ($module, $version_or_range) = @_; + _add_prereq(PREREQ_PM => $module, $version_or_range); +} diff --git a/cpanfile b/cpanfile index c9e9ebb..39a2ae4 100644 --- a/cpanfile +++ b/cpanfile @@ -37,6 +37,7 @@ on 'runtime' => sub { suggests 'Authen::NTLM' => '1.02'; suggests 'IO::Socket::INET'; suggests 'LWP::Protocol::https' => '6.02'; + suggests 'Data::Dump' => '1.13'; }; on 'test' => sub { @@ -44,13 +45,10 @@ on 'test' => sub { requires 'Test::More'; requires 'Test::RequiresInternet'; requires 'FindBin'; + requires 'Test::Needs'; + recommends 'Test::LeakTrace'; }; on 'develop' => sub { - requires 'Test::CheckManifest' => '1.29'; - requires 'Test::CPAN::Changes' => '0.4'; - requires 'Test::CPAN::Meta'; - requires 'Test::Kwalitee' => '1.22'; - requires 'Test::Pod::Spelling::CommonMistakes' => '1.000'; - requires 'Try::Tiny' => '0.24'; + requires 'Authen::NTLM' => '1.02'; }; diff --git a/dist.ini b/dist.ini index cf1efb5..2ecc9e2 100644 --- a/dist.ini +++ b/dist.ini @@ -39,6 +39,11 @@ authority = cpan:LWWWP [Prereqs::FromCPANfile] +[DynamicPrereqs] +:version = 0.018 +; HTTP::Status 6.17 was buggy +-body = requires('HTTP::Status', '6.18') if has_module('HTTP::Status', '6.17'); + [MakeMaker::Awesome] delimiter = | header = |use Getopt::Long qw(GetOptions); @@ -77,6 +82,10 @@ xt_mode = 1 ; [Test::NoTabs] ; TODO [Test::EOL] [Test::ChangesHasContent] +[Substitute] +file = xt/release/changes_has_content.t +code = s{^(note 'Checking Changes')}{if \(\(\$ENV\{TRAVIS_PULL_REQUEST\} \|\| '') eq 'false'\) \{\n chomp\(my \$branch_name = \(\$ENV\{TRAVIS_BRANCH\} || \`git rev-parse --abbrev-ref HEAD\`\)\);\n \$TODO = 'Changes need not have content for this release yet if this is only the master branch'\n if \(\$branch_name \|\| ''\) eq 'master';\n\}\n\n$1} + [Test::MinimumVersion] [PodSyntaxTests] diff --git a/lib/LWP.pm b/lib/LWP.pm index b6a1308..2158ff3 100644 --- a/lib/LWP.pm +++ b/lib/LWP.pm @@ -1,6 +1,6 @@ package LWP; -our $VERSION = '6.33'; +our $VERSION = '6.35'; require LWP::UserAgent; # this should load everything you need diff --git a/lib/LWP/Authen/Basic.pm b/lib/LWP/Authen/Basic.pm index 138b248..62d7574 100644 --- a/lib/LWP/Authen/Basic.pm +++ b/lib/LWP/Authen/Basic.pm @@ -2,7 +2,7 @@ package LWP::Authen::Basic; use strict; -our $VERSION = '6.33'; +our $VERSION = '6.35'; require MIME::Base64; diff --git a/lib/LWP/Authen/Digest.pm b/lib/LWP/Authen/Digest.pm index a223434..1929547 100644 --- a/lib/LWP/Authen/Digest.pm +++ b/lib/LWP/Authen/Digest.pm @@ -3,7 +3,7 @@ package LWP::Authen::Digest; use strict; use base 'LWP::Authen::Basic'; -our $VERSION = '6.33'; +our $VERSION = '6.35'; require Digest::MD5; diff --git a/lib/LWP/Authen/Ntlm.pm b/lib/LWP/Authen/Ntlm.pm index c0c44ac..92c684e 100644 --- a/lib/LWP/Authen/Ntlm.pm +++ b/lib/LWP/Authen/Ntlm.pm @@ -2,7 +2,7 @@ package LWP::Authen::Ntlm; use strict; -our $VERSION = '6.33'; +our $VERSION = '6.35'; use Authen::NTLM "1.02"; use MIME::Base64 "2.12"; diff --git a/lib/LWP/ConnCache.pm b/lib/LWP/ConnCache.pm index e4735c6..0a03cea 100644 --- a/lib/LWP/ConnCache.pm +++ b/lib/LWP/ConnCache.pm @@ -2,7 +2,7 @@ package LWP::ConnCache; use strict; -our $VERSION = '6.33'; +our $VERSION = '6.35'; our $DEBUG; sub new { diff --git a/lib/LWP/Debug.pm b/lib/LWP/Debug.pm index 9efe53b..971dc34 100644 --- a/lib/LWP/Debug.pm +++ b/lib/LWP/Debug.pm @@ -1,6 +1,6 @@ package LWP::Debug; # legacy -our $VERSION = '6.33'; +our $VERSION = '6.35'; require Exporter; our @ISA = qw(Exporter); diff --git a/lib/LWP/Debug/TraceHTTP.pm b/lib/LWP/Debug/TraceHTTP.pm index 90a6cd9..aecf6c0 100644 --- a/lib/LWP/Debug/TraceHTTP.pm +++ b/lib/LWP/Debug/TraceHTTP.pm @@ -11,7 +11,7 @@ package LWP::Debug::TraceHTTP; use strict; use base 'LWP::Protocol::http'; -our $VERSION = '6.33'; +our $VERSION = '6.35'; package # hide from PAUSE LWP::Debug::TraceHTTP::Socket; diff --git a/lib/LWP/DebugFile.pm b/lib/LWP/DebugFile.pm index 5183780..abd40f7 100644 --- a/lib/LWP/DebugFile.pm +++ b/lib/LWP/DebugFile.pm @@ -1,6 +1,6 @@ package LWP::DebugFile; -our $VERSION = '6.33'; +our $VERSION = '6.35'; # legacy stub diff --git a/lib/LWP/MemberMixin.pm b/lib/LWP/MemberMixin.pm index 12a9fdd..1e03e08 100644 --- a/lib/LWP/MemberMixin.pm +++ b/lib/LWP/MemberMixin.pm @@ -1,6 +1,6 @@ package LWP::MemberMixin; -our $VERSION = '6.33'; +our $VERSION = '6.35'; sub _elem { my $self = shift; diff --git a/lib/LWP/Protocol.pm b/lib/LWP/Protocol.pm index e9233be..8812ed2 100644 --- a/lib/LWP/Protocol.pm +++ b/lib/LWP/Protocol.pm @@ -2,7 +2,7 @@ package LWP::Protocol; use base 'LWP::MemberMixin'; -our $VERSION = '6.33'; +our $VERSION = '6.35'; use strict; use Carp (); @@ -100,73 +100,81 @@ sub collect my $content; my($ua, $max_size) = @{$self}{qw(ua max_size)}; - try { + # This can't be moved to Try::Tiny due to the closures within causing + # leaks on any version of Perl prior to 5.18. + # https://perl5.git.perl.org/perl.git/commitdiff/a0d2bbd5c + my $error = do { #catch + local $@; local $\; # protect the print below from surprises - if (!defined($arg) || !$response->is_success) { - $response->{default_add_content} = 1; - } - elsif (!ref($arg) && length($arg)) { - open(my $fh, ">", $arg) or die "Can't write to '$arg': $!"; - binmode($fh); - push(@{$response->{handlers}{response_data}}, { - callback => sub { - print $fh $_[3] or die "Can't write to '$arg': $!"; - 1; - }, - }); - push(@{$response->{handlers}{response_done}}, { - callback => sub { - close($fh) or die "Can't write to '$arg': $!"; - undef($fh); - }, - }); - } - elsif (ref($arg) eq 'CODE') { - push(@{$response->{handlers}{response_data}}, { - callback => sub { - &$arg($_[3], $_[0], $self); - 1; - }, - }); - } - else { - die "Unexpected collect argument '$arg'"; - } + eval { # try + if (!defined($arg) || !$response->is_success) { + $response->{default_add_content} = 1; + } + elsif (!ref($arg) && length($arg)) { + open(my $fh, ">", $arg) or die "Can't write to '$arg': $!"; + binmode($fh); + push(@{$response->{handlers}{response_data}}, { + callback => sub { + print $fh $_[3] or die "Can't write to '$arg': $!"; + 1; + }, + }); + push(@{$response->{handlers}{response_done}}, { + callback => sub { + close($fh) or die "Can't write to '$arg': $!"; + undef($fh); + }, + }); + } + elsif (ref($arg) eq 'CODE') { + push(@{$response->{handlers}{response_data}}, { + callback => sub { + &$arg($_[3], $_[0], $self); + 1; + }, + }); + } + else { + die "Unexpected collect argument '$arg'"; + } - $ua->run_handlers("response_header", $response); + $ua->run_handlers("response_header", $response); - if (delete $response->{default_add_content}) { - push(@{$response->{handlers}{response_data}}, { - callback => sub { - $_[0]->add_content($_[3]); - 1; - }, - }); - } + if (delete $response->{default_add_content}) { + push(@{$response->{handlers}{response_data}}, { + callback => sub { + $_[0]->add_content($_[3]); + 1; + }, + }); + } - my $content_size = 0; - my $length = $response->content_length; - my %skip_h; + my $content_size = 0; + my $length = $response->content_length; + my %skip_h; - while ($content = &$collector, length $$content) { - for my $h ($ua->handlers("response_data", $response)) { - next if $skip_h{$h}; - unless ($h->{callback}->($response, $ua, $h, $$content)) { - # XXX remove from $response->{handlers}{response_data} if present - $skip_h{$h}++; + while ($content = &$collector, length $$content) { + for my $h ($ua->handlers("response_data", $response)) { + next if $skip_h{$h}; + unless ($h->{callback}->($response, $ua, $h, $$content)) { + # XXX remove from $response->{handlers}{response_data} if present + $skip_h{$h}++; + } + } + $content_size += length($$content); + $ua->progress(($length ? ($content_size / $length) : "tick"), $response); + if (defined($max_size) && $content_size > $max_size) { + $response->push_header("Client-Aborted", "max_size"); + last; } } - $content_size += length($$content); - $ua->progress(($length ? ($content_size / $length) : "tick"), $response); - if (defined($max_size) && $content_size > $max_size) { - $response->push_header("Client-Aborted", "max_size"); - last; - } - } - } - catch { - my $error = $_; + 1; + }; + $@; + }; + + if ($error) { chomp($error); $response->push_header('X-Died' => $error); $response->push_header("Client-Aborted", "die"); diff --git a/lib/LWP/Protocol/cpan.pm b/lib/LWP/Protocol/cpan.pm index 7c18f84..2feefed 100644 --- a/lib/LWP/Protocol/cpan.pm +++ b/lib/LWP/Protocol/cpan.pm @@ -4,7 +4,7 @@ use strict; use base qw(LWP::Protocol); -our $VERSION = '6.33'; +our $VERSION = '6.35'; require URI; require HTTP::Status; diff --git a/lib/LWP/Protocol/data.pm b/lib/LWP/Protocol/data.pm index 962c388..50a3e43 100644 --- a/lib/LWP/Protocol/data.pm +++ b/lib/LWP/Protocol/data.pm @@ -4,7 +4,7 @@ package LWP::Protocol::data; use strict; -our $VERSION = '6.33'; +our $VERSION = '6.35'; require HTTP::Response; require HTTP::Status; diff --git a/lib/LWP/Protocol/file.pm b/lib/LWP/Protocol/file.pm index 3460f2e..9bfe573 100644 --- a/lib/LWP/Protocol/file.pm +++ b/lib/LWP/Protocol/file.pm @@ -4,7 +4,7 @@ use base qw(LWP::Protocol); use strict; -our $VERSION = '6.33'; +our $VERSION = '6.35'; require LWP::MediaTypes; require HTTP::Request; diff --git a/lib/LWP/Protocol/ftp.pm b/lib/LWP/Protocol/ftp.pm index 552be3b..c56098d 100644 --- a/lib/LWP/Protocol/ftp.pm +++ b/lib/LWP/Protocol/ftp.pm @@ -5,7 +5,7 @@ package LWP::Protocol::ftp; use base qw(LWP::Protocol); use strict; -our $VERSION = '6.33'; +our $VERSION = '6.35'; use Carp (); use HTTP::Status (); diff --git a/lib/LWP/Protocol/gopher.pm b/lib/LWP/Protocol/gopher.pm index c003233..2466960 100644 --- a/lib/LWP/Protocol/gopher.pm +++ b/lib/LWP/Protocol/gopher.pm @@ -9,7 +9,7 @@ package LWP::Protocol::gopher; use strict; -our $VERSION = '6.33'; +our $VERSION = '6.35'; require HTTP::Response; require HTTP::Status; diff --git a/lib/LWP/Protocol/http.pm b/lib/LWP/Protocol/http.pm index b42628e..4d7663f 100644 --- a/lib/LWP/Protocol/http.pm +++ b/lib/LWP/Protocol/http.pm @@ -2,7 +2,7 @@ package LWP::Protocol::http; use strict; -our $VERSION = '6.33'; +our $VERSION = '6.35'; require HTTP::Response; require HTTP::Status; diff --git a/lib/LWP/Protocol/loopback.pm b/lib/LWP/Protocol/loopback.pm index f0db901..4719361 100644 --- a/lib/LWP/Protocol/loopback.pm +++ b/lib/LWP/Protocol/loopback.pm @@ -2,7 +2,7 @@ package LWP::Protocol::loopback; use strict; -our $VERSION = '6.33'; +our $VERSION = '6.35'; require HTTP::Response; diff --git a/lib/LWP/Protocol/mailto.pm b/lib/LWP/Protocol/mailto.pm index 81c814f..937f38f 100644 --- a/lib/LWP/Protocol/mailto.pm +++ b/lib/LWP/Protocol/mailto.pm @@ -11,7 +11,7 @@ require HTTP::Status; use Carp; use strict; -our $VERSION = '6.33'; +our $VERSION = '6.35'; use base qw(LWP::Protocol); our $SENDMAIL; diff --git a/lib/LWP/Protocol/nntp.pm b/lib/LWP/Protocol/nntp.pm index eeb6e19..f265229 100644 --- a/lib/LWP/Protocol/nntp.pm +++ b/lib/LWP/Protocol/nntp.pm @@ -4,7 +4,7 @@ package LWP::Protocol::nntp; use base qw(LWP::Protocol); -our $VERSION = '6.33'; +our $VERSION = '6.35'; require HTTP::Response; require HTTP::Status; diff --git a/lib/LWP/Protocol/nogo.pm b/lib/LWP/Protocol/nogo.pm index cab40cc..1e56ae0 100644 --- a/lib/LWP/Protocol/nogo.pm +++ b/lib/LWP/Protocol/nogo.pm @@ -7,7 +7,7 @@ package LWP::Protocol::nogo; use strict; -our $VERSION = '6.33'; +our $VERSION = '6.35'; require HTTP::Response; require HTTP::Status; diff --git a/lib/LWP/RobotUA.pm b/lib/LWP/RobotUA.pm index b2a6ae6..1c869ec 100644 --- a/lib/LWP/RobotUA.pm +++ b/lib/LWP/RobotUA.pm @@ -2,7 +2,7 @@ package LWP::RobotUA; use base qw(LWP::UserAgent); -our $VERSION = '6.33'; +our $VERSION = '6.35'; require WWW::RobotRules; require HTTP::Request; diff --git a/lib/LWP/Simple.pm b/lib/LWP/Simple.pm index 0e97a4e..7da7390 100644 --- a/lib/LWP/Simple.pm +++ b/lib/LWP/Simple.pm @@ -2,7 +2,7 @@ package LWP::Simple; use strict; -our $VERSION = '6.33'; +our $VERSION = '6.35'; require Exporter; diff --git a/lib/LWP/UserAgent.pm b/lib/LWP/UserAgent.pm index 681c972..e87a694 100644 --- a/lib/LWP/UserAgent.pm +++ b/lib/LWP/UserAgent.pm @@ -15,7 +15,7 @@ use LWP::Protocol (); use Scalar::Util qw(blessed); use Try::Tiny qw(try catch); -our $VERSION = '6.33'; +our $VERSION = '6.35'; sub new { @@ -1241,7 +1241,7 @@ method is the old attribute value. =head2 agent my $agent = $ua->agent; - $ua->agent('Checkbot/0.4 '); # append the defaul to the end + $ua->agent('Checkbot/0.4 '); # append the default to the end $ua->agent('Mozilla/5.0'); $ua->agent(""); # don't identify @@ -1507,11 +1507,16 @@ https-URLs. Get/set the timeout value in seconds. The default value is 180 seconds, i.e. 3 minutes. -The requests is aborted if no activity on the connection to the server +The request is aborted if no activity on the connection to the server is observed for C seconds. This means that the time it takes for the complete transaction and the L method to actually return might be longer. +When a request times out, a response object is still returned. The response +will have a standard HTTP Status Code (500). This response will have the +"Client-Warning" header set to the value of "Internal response". See the +L method description below for further details. + =head1 PROXY ATTRIBUTES The following methods set up when requests should be passed via a diff --git a/t/00-report-prereqs.dd b/t/00-report-prereqs.dd index c53b09a..6b9e91e 100644 --- a/t/00-report-prereqs.dd +++ b/t/00-report-prereqs.dd @@ -1,38 +1,32 @@ do { my $x = { 'configure' => { 'requires' => { + 'CPAN::Meta::Requirements' => '2.120620', 'ExtUtils::MakeMaker' => '0', 'File::Copy' => '0', - 'Getopt::Long' => '0' - }, - 'suggests' => { - 'JSON::PP' => '2.27300' + 'Getopt::Long' => '0', + 'Module::Metadata' => '0' } }, 'develop' => { 'recommends' => { - 'Dist::Zilla::PluginBundle::Git::VersionManager' => '0.005' + 'Dist::Zilla::PluginBundle::Git::VersionManager' => '0.007' }, 'requires' => { + 'Authen::NTLM' => '1.02', 'File::Spec' => '0', 'IO::Handle' => '0', 'IPC::Open3' => '0', 'Pod::Coverage::TrustPod' => '0', - 'Test::CPAN::Changes' => '0.4', - 'Test::CPAN::Meta' => '0', - 'Test::CheckManifest' => '1.29', 'Test::EOL' => '0', - 'Test::Kwalitee' => '1.22', 'Test::MinimumVersion' => '0', 'Test::Mojibake' => '0', 'Test::More' => '0.94', 'Test::Pod' => '1.41', 'Test::Pod::Coverage' => '1.08', - 'Test::Pod::Spelling::CommonMistakes' => '1.000', 'Test::Portability::Files' => '0', 'Test::Spelling' => '0.12', - 'Test::Version' => '1', - 'Try::Tiny' => '0.24' + 'Test::Version' => '1' } }, 'runtime' => { @@ -69,13 +63,15 @@ do { my $x = { }, 'suggests' => { 'Authen::NTLM' => '1.02', + 'Data::Dump' => '1.13', 'IO::Socket::INET' => '0', 'LWP::Protocol::https' => '6.02' } }, 'test' => { 'recommends' => { - 'CPAN::Meta' => '2.120900' + 'CPAN::Meta' => '2.120900', + 'Test::LeakTrace' => '0' }, 'requires' => { 'ExtUtils::MakeMaker' => '0', @@ -83,6 +79,7 @@ do { my $x = { 'FindBin' => '0', 'Test::Fatal' => '0', 'Test::More' => '0', + 'Test::Needs' => '0', 'Test::RequiresInternet' => '0' } } diff --git a/t/leak/no_leak.t b/t/leak/no_leak.t new file mode 100644 index 0000000..f2b1ce6 --- /dev/null +++ b/t/leak/no_leak.t @@ -0,0 +1,26 @@ +use strict; +use warnings; + +# To ensure "no leak" in real LWP code, we should test it against HTTP servers. +# However, HTTPS is not required here, so let's use an HTTP site neverssl.com. +use Test::RequiresInternet 'neverssl.com' => 80; + +use Test::More; +use Test::Needs 'Test::LeakTrace'; + +use File::Temp (); +use LWP::UserAgent; + +plan skip_all => 'skip leak test in COVERAGE' if $ENV{COVERAGE}; + +my ($tempfh, $tempfile) = File::Temp::tempfile(UNLINK => 0); +close $tempfh; + +Test::LeakTrace::no_leaks_ok(sub { + my $ua = LWP::UserAgent->new; + my $res = $ua->get("http://neverssl.com/", ':content_file' => $tempfile); +}); + +unlink $tempfile; + +done_testing; diff --git a/xt/author/eol.t b/xt/author/eol.t index 99dff4f..fa1640e 100644 --- a/xt/author/eol.t +++ b/xt/author/eol.t @@ -44,6 +44,7 @@ my @files = ( 't/base/simple.t', 't/base/ua.t', 't/base/ua_handlers.t', + 't/leak/no_leak.t', 't/local/autoload-get.t', 't/local/autoload.t', 't/local/get.t', diff --git a/xt/author/minimum-version.t b/xt/author/minimum-version.t new file mode 100644 index 0000000..6af92e0 --- /dev/null +++ b/xt/author/minimum-version.t @@ -0,0 +1,6 @@ +#!perl + +use Test::More; + +use Test::MinimumVersion; +all_minimum_version_from_metayml_ok(); diff --git a/xt/author/pod-spell.t b/xt/author/pod-spell.t index a692aa3..37d87d5 100644 --- a/xt/author/pod-spell.t +++ b/xt/author/pod-spell.t @@ -19,6 +19,8 @@ Alex Alexandre Alexey Andreas +Andrew +Anirvan Asplund Atzberger Authen @@ -41,6 +43,7 @@ Cardillo Ceccarelli Chamas Chase +Chatterjee Christopher Chrysostomos Colin @@ -48,6 +51,7 @@ ConnCache Coppit Couzins DAVIDRW +Daignault Daina Dalgleish Daniel @@ -55,6 +59,7 @@ David Debug DebugFile Denaxas +Desmond Digest Doug Dubois @@ -79,6 +84,7 @@ Gondwana Graaff Graeme Graham +Grangaard Greab Gregoire Gregory @@ -109,6 +115,7 @@ Joerg John Jr KONISHI +Kaji Kaminsky Kapranoff Karaban @@ -208,6 +215,7 @@ Schwern Sean Sergey Shirazi +Shoichi Simple Sjogren Skyttä @@ -273,6 +281,7 @@ akiym amir amire80 andreas +anirvan asjo at bin @@ -307,6 +316,7 @@ github gong gopher gpeters +granny haarg hfroehlich http @@ -333,6 +343,7 @@ michiel mmcleric murphy naveedm9 +nawglan nigelgregoire nntp nogo @@ -353,6 +364,7 @@ sburke schwern shaohua shildreth +skaji slaven sprout sromanov diff --git a/xt/release/changes_has_content.t b/xt/release/changes_has_content.t index 09296ac..43c51b7 100644 --- a/xt/release/changes_has_content.t +++ b/xt/release/changes_has_content.t @@ -1,8 +1,14 @@ use Test::More tests => 2; +if (($ENV{TRAVIS_PULL_REQUEST} || '') eq 'false') { + chomp(my $branch_name = ($ENV{TRAVIS_BRANCH} || `git rev-parse --abbrev-ref HEAD`)); + $TODO = 'Changes need not have content for this release yet if this is only the master branch' + if ($branch_name || '') eq 'master'; +} + note 'Checking Changes'; my $changes_file = 'Changes'; -my $newver = '6.33'; +my $newver = '6.35'; my $trial_token = '-TRIAL'; my $encoding = 'UTF-8'; diff --git a/xt/release/minimum-version.t b/xt/release/minimum-version.t deleted file mode 100644 index d108c79..0000000 --- a/xt/release/minimum-version.t +++ /dev/null @@ -1,8 +0,0 @@ -#!perl - -use Test::More; - -eval "use Test::MinimumVersion"; -plan skip_all => "Test::MinimumVersion required for testing minimum versions" - if $@; -all_minimum_version_from_metayml_ok(); -- 2.34.1