r65373 - in /trunk/libwww-curl-perl: ./ debian/ lib/WWW/ lib/WWW/Curl/ t/ template/
carnil at users.alioth.debian.org
carnil at users.alioth.debian.org
Sun Nov 28 21:14:06 UTC 2010
Author: carnil
Date: Sun Nov 28 21:13:56 2010
New Revision: 65373
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=65373
Log:
New upstream release
Added:
trunk/libwww-curl-perl/t/symbols-in-versions
- copied unchanged from r65372, branches/upstream/libwww-curl-perl/current/t/symbols-in-versions
Modified:
trunk/libwww-curl-perl/Changes
trunk/libwww-curl-perl/Curl.xs
trunk/libwww-curl-perl/MANIFEST
trunk/libwww-curl-perl/META.yml
trunk/libwww-curl-perl/Makefile.PL
trunk/libwww-curl-perl/SIGNATURE
trunk/libwww-curl-perl/debian/changelog
trunk/libwww-curl-perl/lib/WWW/Curl.pm
trunk/libwww-curl-perl/lib/WWW/Curl/Easy.pm
trunk/libwww-curl-perl/lib/WWW/Curl/Form.pm
trunk/libwww-curl-perl/lib/WWW/Curl/Share.pm
trunk/libwww-curl-perl/t/00constants.t
trunk/libwww-curl-perl/t/01basic.t
trunk/libwww-curl-perl/t/19multi.t
trunk/libwww-curl-perl/template/Easy.pm.tmpl
trunk/libwww-curl-perl/template/Share.pm.tmpl
Modified: trunk/libwww-curl-perl/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libwww-curl-perl/Changes?rev=65373&op=diff
==============================================================================
--- trunk/libwww-curl-perl/Changes (original)
+++ trunk/libwww-curl-perl/Changes Sun Nov 28 21:13:56 2010
@@ -1,4 +1,9 @@
Revision history for the Perl binding of libcurl, WWW::Curl.
+4.15 Sun Nov 28 2010: - Balint Szilakszi <szbalint at cpan.org>
+
+ - Refactored constant handling and added thorough testing for it.
+ - Fixed CURLOPT_PRIVATE, it is now a string and can be set/get accordingly.
+
4.14 Sun Oct 24 2010: - Balint Szilakszi <szbalint at cpan.org>
- Scalar references can now be used to receive body/header data [gfx].
Modified: trunk/libwww-curl-perl/Curl.xs
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libwww-curl-perl/Curl.xs?rev=65373&op=diff
==============================================================================
--- trunk/libwww-curl-perl/Curl.xs (original)
+++ trunk/libwww-curl-perl/Curl.xs Sun Nov 28 21:13:56 2010
@@ -814,10 +814,6 @@
croak("value is not of type WWW::Curl::Share");
break;
#endif
- case CURLOPT_PRIVATE:
- RETVAL = curl_easy_setopt(self->curl, option, (long)SvIV(value));
- break;
-
/* default cases */
default:
if (option < CURLOPTTYPE_OBJECTPOINT) { /* A long (integer) value */
@@ -1078,7 +1074,7 @@
PREINIT:
CURL *easy = NULL;
CURLcode res;
- long stashid;
+ char *stashid;
int queue;
CURLMsg *msg;
PPCODE:
@@ -1093,7 +1089,7 @@
curl_easy_getinfo(easy, CURLINFO_PRIVATE, &stashid);
curl_easy_setopt(easy, CURLINFO_PRIVATE, NULL);
curl_multi_remove_handle(self->curlm, easy);
- XPUSHs(sv_2mortal(newSViv(stashid)));
+ XPUSHs(sv_2mortal(newSVpv(stashid,0)));
XPUSHs(sv_2mortal(newSViv(res)));
} else {
XSRETURN_EMPTY;
Modified: trunk/libwww-curl-perl/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libwww-curl-perl/MANIFEST?rev=65373&op=diff
==============================================================================
--- trunk/libwww-curl-perl/MANIFEST (original)
+++ trunk/libwww-curl-perl/MANIFEST Sun Nov 28 21:13:56 2010
@@ -53,6 +53,7 @@
t/new/README
t/pod-coverage.t
t/pod.t
+t/symbols-in-versions
template/Easy.pm.tmpl
template/Share.pm.tmpl
typemap
Modified: trunk/libwww-curl-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libwww-curl-perl/META.yml?rev=65373&op=diff
==============================================================================
--- trunk/libwww-curl-perl/META.yml (original)
+++ trunk/libwww-curl-perl/META.yml Sun Nov 28 21:13:56 2010
@@ -24,4 +24,4 @@
perl: 5.6.1
resources:
repository: http://github.com/szbalint/WWW--Curl
-version: 4.14
+version: 4.15
Modified: trunk/libwww-curl-perl/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libwww-curl-perl/Makefile.PL?rev=65373&op=diff
==============================================================================
--- trunk/libwww-curl-perl/Makefile.PL (original)
+++ trunk/libwww-curl-perl/Makefile.PL Sun Nov 28 21:13:56 2010
@@ -41,9 +41,6 @@
my @includes = qw();
my ($cflags,$lflags, $ldflags) = ('','','');
-# This utility helper generates the constants function from curl.h
-# It is normally only used by the maintainer, but if you're curl is older
-# or missing some constants, you can delete curlopt-constants.c and re-run 'perl Makefile.PL'
# You may need to specify where to find curl.h on your platform
# These are guesses only, in case curl-config is not telling us.
@@ -96,37 +93,65 @@
}
if (!defined($curl_h)) {
- die "Cannot find curl.h - cannot build constants files - see Makefile.PL";
+ die "Cannot find curl.h - cannot build constants files - see Makefile.PL";
} else {
- $curl_d = "-I" . $curl_d;
- print "Found curl.h in $curl_h\n";
+ my %constants;
+ $curl_d = "-I" . $curl_d;
+ print "Found curl.h in $curl_h\n";
+ my @syms;
+ my $has_cpp = 0;
+ open(H_IN, "-|", "cpp", $curl_h) and $has_cpp++;
+ unless ($has_cpp) { open(H_IN, "<", $curl_h) or die("Can't open curl.h at path $curl_h, because: ".$!); }
+ while ( <H_IN> ) {
+ if ( /enum\s+(\S+\s+)?{/ .. /}/ ) {
+ s/^\s+//;
+ next unless /^CURL/;
+ chomp;
+ s/[,\s].*//;
+ s/=.*$//;
+ next unless /^\w+$/;
+ push @syms, $_;
+ }
+ }
+ close H_IN;
+ open (H, "<", $curl_h) or die ("Cannot open $curl_h: ".$!);
+ while(<H>) {
+ if (/^#define (CURL[A-Za-z0-9_]*)/) {
+ push @syms, $1;
+ }
+ }
+ close H;
+
+ for my $e (sort @syms) {
+ if($e =~ /(OBSOLETE|^CURL_EXTERN|_LAST\z|_LASTENTRY\z)/) {
+ next;
+ }
+ my ($group) = $e =~ m/^([^_]+_)/;
+ $constants{$group}->{$e} = $e;
+ }
+ unless ($has_cpp) {
open(CURL_H, "<" . $curl_h) or die "Can't open curl.h\n";
- my %constants;
while (<CURL_H>) {
if ($_ =~ m/CINIT\(/ and $_ !~ m/#/) {
- my ($option, $type, $code) =
- m/.*CINIT\((\w*)\s*,\s*(\w+)\s*,\s*(\d+).*/;
- $constants{CURLOPT_}->{$option} = $option;
+ my ($option, $type, $code) = m/.*CINIT\((\w*)\s*,\s*(\w+)\s*,\s*(\d+).*/;
+ $constants{"CURLOPT_"}->{"CURLOPT_".$option} = "CURLOPT_".$option;
} elsif ($_ =~ m/^#define CURLOPT_\w+\s+CURLOPT_\w+/) {
my ($option, $value) =
m/^#define CURLOPT_(\w+)\s+CURLOPT_(\w+)/;
- $constants{CURLOPT_}->{$option} = $value;
- } elsif ($_ =~ m/^\s*(CURLINFO_|CURLSHOPT_|CURLE_|CURL_LOCK_)(\w+)/) {
- $constants{$1}->{$2} = $2;
- } elsif ($_ =~ m/^\s*(CURL_)(\w+)(?:[,\s]*)(?:\/\*.*)?$/) {
- $constants{$1}->{$2} = $2;
- } elsif ($_ =~ m/^\s*CURLPROXY_(\w+)\s*=\s*\d+/) {
- $constants{CURLPROXY_}->{$1} = $1;
- }
-
+ $constants{"CURLOPT_"}->{"CURLOPT_".$option} = "CURLOPT_".$value;
+ } elsif ($_ =~ m/^\s*((CURLINFO_|CURLSHOPT_|CURLE_)\w+)/) {
+ $constants{$2}->{$1}= $1;
+ } elsif ($_ =~ m/^\s*((CURL_)(?:\w+))(?:[,\s]*)(?:\/\*.*)?$/) {
+ $constants{$2}->{$1} = $1;
+ } elsif ($_ =~ m/^\s*((CURLPROXY_)(?:\w+))\s*=\s*\d+/) {
+ $constants{$2}->{$1} = $1;
+ } elsif ($_ =~ m/CFINIT\(/ and $_ !~ m/#/) {
+ my ($option) = m/.*CFINIT\((\w*)\s*.*/;
+ $constants{"CURLFORM_"}->{"CURLFORM_".$option} = "CURLFORM_".$option;
+ }
}
close(CURL_H);
-
- # some things are ifdefed out...
- foreach my $ifdef0 (qw(FLAGS PROGRESSMODE MOREDOCS)) {
- delete $constants{CURLOPT_}->{$ifdef0};
- }
-
+ }
print "Building curlopt-constants.c for your libcurl version\n";
open(CURL_XS, ">curlopt-constants.c")
@@ -140,7 +165,7 @@
errno = 0;
HERE
;
-for my $group (sort keys %constants) {
+for my $group (reverse sort keys %constants) {
my $grouplength = length($group);
my $groupref = $constants{$group};
my @constants = keys %{$constants{$group}};
@@ -156,11 +181,12 @@
print CURL_XS " case '$next_initial':\n";
my $count = 0;
foreach my $option (sort @constants) {
- my $initial = substr($option, 0, 1);
+ my $remainder = substr($option, length($group), length($option));
+ my $initial = substr($remainder, 0, 1);
if ($next_initial eq $initial) {
print CURL_XS
-" if (strEQ(name, \"$option\")) return $group"."$groupref->{$option};\n";
+" if (strEQ(name, \"$remainder\")) return "."$groupref->{$option};\n";
$count++;
}
@@ -192,10 +218,10 @@
if ($line !~ m/^\@CURLOPT_INCLUDE\@/) {
print EASY_PM $line;
} else {
- for my $group (qw/CURLOPT_ CURLINFO_ CURLE_ CURL_ CURLPROXY_/) {
+ for my $group (reverse sort keys %constants) {
for my $option (sort keys %{$constants{$group}}) {
next unless $option;
- print EASY_PM $group.$option."\n";
+ print EASY_PM $option."\n";
}
}
}
@@ -212,10 +238,10 @@
print SHARE_PM $line;
} else {
foreach my $option (sort keys %{$constants{CURLSHOPT_}}) {
- print SHARE_PM $1 . "CURLSHOPT_".$option . "\n";
+ print SHARE_PM $1 . $option . "\n";
}
foreach my $option (sort keys %{$constants{CURL_LOCK_}}) {
- print SHARE_PM $1 . "CURL_LOCK_".$option . "\n";
+ print SHARE_PM $1 . $option . "\n";
}
}
}
Modified: trunk/libwww-curl-perl/SIGNATURE
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libwww-curl-perl/SIGNATURE?rev=65373&op=diff
==============================================================================
--- trunk/libwww-curl-perl/SIGNATURE (original)
+++ trunk/libwww-curl-perl/SIGNATURE Sun Nov 28 21:13:56 2010
@@ -14,12 +14,12 @@
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
-SHA1 fcabd943225c88f9aa1039761a0e43f8ef01b40a Changes
-SHA1 478b1942dc6fe9dcbc10c3f1849dfa46446370de Curl.xs
+SHA1 c23d2d3256e487cfeb2fba5d11861e6ef1f9c6dd Changes
+SHA1 65a31f18075b247c6d4bc38ba5fe408f3bd9b2c5 Curl.xs
SHA1 94cbea5b3fb940e25cd4535d1c81bfd7d51dac3c LICENSE
-SHA1 9dc4200fb6a801473e78843217a2835ee7c390a4 MANIFEST
-SHA1 5c2c13c7cc93ee8e882221d2d40e9f5aee954abd META.yml
-SHA1 b6eaa6b551f80e0b2520a654e7a3ea897603e6d4 Makefile.PL
+SHA1 7cae1c2346a6ce99ac5325cabb51b7ce4ebad209 MANIFEST
+SHA1 3c88c4db0ddf4624cc22454d5e1f996ef2b0988a META.yml
+SHA1 03e0e48557e565a4663c30bfe8f75660c1336e0f Makefile.PL
SHA1 3e8bbd9aa6cd273aef05f78cfef0116a0e3d59b0 README
SHA1 ed6f9f399075307a33bd02902ebbadbbbfbd8bab README.Win32
SHA1 fd5f3c4f0418efee3b9b16cf8c3902e8374909df inc/Module/Install.pm
@@ -29,13 +29,13 @@
SHA1 dbec1085a29a855202ee797a5bac319cf426827f inc/Module/Install/MakeMaker.pm
SHA1 3e83972921d54198d1246f7278f08664006cd65d inc/Module/Install/Makefile.pm
SHA1 12bf1867955480d47d5171a9e9c6a96fabe0b58f inc/Module/Install/Metadata.pm
-SHA1 dbda7543f5ce9a1a6c900e00a87916932fe639d0 lib/WWW/Curl.pm
-SHA1 1c83271333d4d6f9766352b09a73b45e79bf5ec1 lib/WWW/Curl/Easy.pm
-SHA1 84564a68236d7458d8cf82319efadc02621c51d8 lib/WWW/Curl/Form.pm
+SHA1 2d3ace586b9c815af387d69d5c6645e139777775 lib/WWW/Curl.pm
+SHA1 7909ec25b1dfe3499fd9fab597ed958dbe1169e1 lib/WWW/Curl/Easy.pm
+SHA1 0f4db7cb0e4ba57e0c7869f6932322911b55d4cd lib/WWW/Curl/Form.pm
SHA1 0bddc700447a50dd26d13119ee60349556ce1811 lib/WWW/Curl/Multi.pm
-SHA1 08df49894fc724e358676a80ca7cd3895bc30b9a lib/WWW/Curl/Share.pm
-SHA1 802cb1fcd35fe78e4cdb10164a05e54ce1427543 t/00constants.t
-SHA1 a6bd16e0cd3ad3923e71955b98eb08ddcde07bd5 t/01basic.t
+SHA1 7dbc5c2e1144c4e4ae75d6259bc16d713913f6f5 lib/WWW/Curl/Share.pm
+SHA1 3874fe0b4d751149e6ede0967ccec514f3b90756 t/00constants.t
+SHA1 83dbfe8cf1c1c567436daa3cc2a7f92e40285139 t/01basic.t
SHA1 07b63b1baca142a0e34e79633d0eb57684524bed t/02callbacks.t
SHA1 905c848deb6492d539c5bdf89c49632a412af15a t/04abort-test.t
SHA1 f9c842503835908a0687ab41655042a16b8b5112 t/05progress.t
@@ -50,7 +50,7 @@
SHA1 785507b3fa6f414298cdcf7ceaba1f9274aa07d2 t/16formpost.t
SHA1 e784a874eb36fd5b16a12fc58365cce697ecbbab t/17slist.t
SHA1 9b80d6de1675261d43abea2f76cfd610f42a4494 t/18twinhandles.t
-SHA1 7daab9e7051396cef5f2a37b52cc6ee1c99be98e t/19multi.t
+SHA1 2591e39d5346fb4effca23d3ccef224322d843d7 t/19multi.t
SHA1 42f7f35d7ac8b38838cc71fdc7a89402b63e01b7 t/20undefined_subs.t
SHA1 c0daf235a136f623fc29ae5c2c2ce6cfc68a9b5f t/21write-to-scalar.t
SHA1 2924361d0713031b92c6b888f11e860d357837f7 t/meta.t
@@ -68,13 +68,14 @@
SHA1 20ec0bd03ff2600505d38623153a6eb3087b5814 t/new/README
SHA1 ac25bfa56d36f19cbee72a968b06372e88602a61 t/pod-coverage.t
SHA1 0190346d7072d458c8a10a45c19f86db641dcc48 t/pod.t
-SHA1 a04ab9054821da678e0f43da2c4f6da7177adc53 template/Easy.pm.tmpl
-SHA1 f690cca3adf6c17840985fe40c22ee56fdfb999f template/Share.pm.tmpl
+SHA1 1811cc3766dbb601d0ae0aea284b6e0a642a483a t/symbols-in-versions
+SHA1 dc1cf787a6dec7d4e263f95a1566369f51b94746 template/Easy.pm.tmpl
+SHA1 f6f5d52b1d34bff9d085ac40bbc6f8b2a6269c58 template/Share.pm.tmpl
SHA1 468b011caaf4d54609b421027d7c6262a9260e89 typemap
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
-iF4EAREIAAYFAkzEhrYACgkQ9vEeIen/Zj4XIwD/cdSn+iaFq7Y62i8WGCfGDQjT
-3g3L10PbxmuoMT1bRcUA/0a+JO8OxUrQNOXmOe4zzEVYjdSc8Aq9ypVwdwuVESkV
-=iums
+iF4EAREIAAYFAkzyt84ACgkQ9vEeIen/Zj4wSAD/Z0JHQVK5ie0xOBkD+4A1vAWb
+A0JWUq6/8e9GNyVtjJoA/20hxeygZr4zddpfZ4AakE6f9m3+g3KEKo73+26HgZYq
+=YZHu
-----END PGP SIGNATURE-----
Modified: trunk/libwww-curl-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libwww-curl-perl/debian/changelog?rev=65373&op=diff
==============================================================================
--- trunk/libwww-curl-perl/debian/changelog (original)
+++ trunk/libwww-curl-perl/debian/changelog Sun Nov 28 21:13:56 2010
@@ -1,8 +1,12 @@
-libwww-curl-perl (4.14-2) UNRELEASED; urgency=low
-
+libwww-curl-perl (4.15-1) UNRELEASED; urgency=low
+
+ [ Ansgar Burchardt ]
* Update my email address.
- -- Ansgar Burchardt <ansgar at debian.org> Mon, 01 Nov 2010 11:17:35 +0100
+ [ Salvatore Bonaccorso ]
+ * New upstream release
+
+ -- Salvatore Bonaccorso <carnil at debian.org> Sun, 28 Nov 2010 22:13:35 +0100
libwww-curl-perl (4.14-1) unstable; urgency=low
Modified: trunk/libwww-curl-perl/lib/WWW/Curl.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libwww-curl-perl/lib/WWW/Curl.pm?rev=65373&op=diff
==============================================================================
--- trunk/libwww-curl-perl/lib/WWW/Curl.pm (original)
+++ trunk/libwww-curl-perl/lib/WWW/Curl.pm Sun Nov 28 21:13:56 2010
@@ -4,7 +4,7 @@
use warnings;
use XSLoader;
-our $VERSION = '4.14';
+our $VERSION = '4.15';
XSLoader::load(__PACKAGE__, $VERSION);
END {
@@ -70,6 +70,7 @@
print("An error happened: $retcode ".$curl->strerror($retcode)." ".$curl->errbuf."\n");
}
+See L<curl_easy_setopt(3)> for details of C<setopt()>.
=head1 WWW::Curl::Multi
@@ -308,6 +309,10 @@
It might be surprising that if C<CURLOPT_FOLLOWLOCATION> is set and header output was enabled, headers show up for all http responses.
The reasoning behind that and possible code adjustments are outlined here: L<https://rt.cpan.org/Ticket/Display.html?id=61569>.
+=head2 CURLOPT_PRIVATE
+
+Despite what the libcurl manual says, in Perl land, only string values are suitable for this option.
+
=head1 ADDITIONAL METHODS
=head2 On WWW::Curl::Easy objects
@@ -399,4 +404,6 @@
L<http://search.cpan.org/perldoc?WWW::Curl::Simple>
+L<libcurl(3)>
+
The development source code is also available: L<http://github.com/szbalint/WWW--Curl/tree/master>
Modified: trunk/libwww-curl-perl/lib/WWW/Curl/Easy.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libwww-curl-perl/lib/WWW/Curl/Easy.pm?rev=65373&op=diff
==============================================================================
--- trunk/libwww-curl-perl/lib/WWW/Curl/Easy.pm (original)
+++ trunk/libwww-curl-perl/lib/WWW/Curl/Easy.pm Sun Nov 28 21:13:56 2010
@@ -4,7 +4,7 @@
use warnings;
use Carp;
-our $VERSION = '4.14';
+our $VERSION = '4.15';
use WWW::Curl ();
use Exporter ();
Modified: trunk/libwww-curl-perl/lib/WWW/Curl/Form.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libwww-curl-perl/lib/WWW/Curl/Form.pm?rev=65373&op=diff
==============================================================================
--- trunk/libwww-curl-perl/lib/WWW/Curl/Form.pm (original)
+++ trunk/libwww-curl-perl/lib/WWW/Curl/Form.pm Sun Nov 28 21:13:56 2010
@@ -3,7 +3,7 @@
use warnings;
use Carp;
-our $VERSION = '4.14';
+our $VERSION = '4.15';
use WWW::Curl ();
use Exporter ();
Modified: trunk/libwww-curl-perl/lib/WWW/Curl/Share.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libwww-curl-perl/lib/WWW/Curl/Share.pm?rev=65373&op=diff
==============================================================================
--- trunk/libwww-curl-perl/lib/WWW/Curl/Share.pm (original)
+++ trunk/libwww-curl-perl/lib/WWW/Curl/Share.pm Sun Nov 28 21:13:56 2010
@@ -19,8 +19,8 @@
( my $constname = $AUTOLOAD ) =~ s/.*:://;
my $value = constant( $constname );
- if($!) {
- croak("Undefined subroutine &$AUTOLOAD failed");
+ if ($!) {
+ croak("Undefined subroutine &$AUTOLOAD failed for reasons of $!, constname was $constname, value was: $value");
}
{
Modified: trunk/libwww-curl-perl/t/00constants.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libwww-curl-perl/t/00constants.t?rev=65373&op=diff
==============================================================================
--- trunk/libwww-curl-perl/t/00constants.t (original)
+++ trunk/libwww-curl-perl/t/00constants.t Sun Nov 28 21:13:56 2010
@@ -1,9 +1,60 @@
#!perl
use strict;
use warnings;
-use Test::More tests => 3;
+use Test::More;
+use WWW::Curl::Easy;
-BEGIN { use_ok( 'WWW::Curl::Easy' ); }
+my $ver_num_raw = WWW::Curl::Easy::version();
+my ($ver_num) = $ver_num_raw =~ m!libcurl/(\d\.\d+\.\d+)!;
+my ($major, $minor, $bugfix) = split(/\./, $ver_num);
-ok (CURLOPT_URL == 10000+2, "Constant loaded ok");
-ok (CURLE_URL_MALFORMAT, "CURLE_ error constant can be used");
+open(my $fh, '<', 't/symbols-in-versions') or die($!);
+
+my @consts;
+for my $row (<$fh>) {
+ chomp($row);
+ next if ($row =~ m/^#/);
+ my ($name, $intro, $dep, $remov) = split(/\s+/, $row);
+ push @consts, [$name, $intro, $dep, $remov];
+}
+
+# In case we can't use cpp to extract symbols, skipping the multi constant tests for now.
+my $skip_multi;
+my $value = WWW::Curl::Easy::constant('CURL_LAST');
+$skip_multi++ if (! $!);
+
+my @checklist;
+for my $row (@consts) {
+ my ($name, $intro, $depr, $outro) = @{$row};
+ my $check = 0;
+ if (!$outro && $intro) {
+ my ($maj_in, $min_in, $bf_in) = split(/\./, $intro);
+ if ($maj_in eq '-' || $major > $maj_in) {
+ $check = 1;
+ } elsif ($major == $maj_in) {
+ if ($minor > $min_in) { $check = 1
+ } elsif ($minor == $min_in ) {
+ if ($bugfix > $bf_in) {
+ $check = 1;
+ } elsif ($bugfix == $bf_in) {
+ $check = 1;
+ } else {
+ next
+ }
+ } else {
+ next;
+ }
+ } else {
+ next;
+ }
+ }
+ if ($check) {
+ next if ($skip_multi && $name =~ m/^CURLM/);
+ push @checklist, [$name, $depr];
+ }
+}
+plan tests => scalar(@checklist);
+for my $row (@checklist) {
+ my $value = WWW::Curl::Easy::constant($row->[0]);
+ ok(!$! && (defined($value) || $row->[1]), "$row->[0] is defined alright - $!");
+}
Modified: trunk/libwww-curl-perl/t/01basic.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libwww-curl-perl/t/01basic.t?rev=65373&op=diff
==============================================================================
--- trunk/libwww-curl-perl/t/01basic.t (original)
+++ trunk/libwww-curl-perl/t/01basic.t Sun Nov 28 21:13:56 2010
@@ -40,7 +40,7 @@
my $retcode = $curl->perform();
ok(! $retcode, "Curl return code ok");
-
+diag("An error happened: $retcode ".$curl->strerror($retcode)." ".$curl->errbuf."\n") if ($retcode);
my $bytes = $curl->getinfo(CURLINFO_SIZE_DOWNLOAD);
ok( $bytes, "getinfo returns non-zero number of bytes");
my $realurl = $curl->getinfo(CURLINFO_EFFECTIVE_URL);
Modified: trunk/libwww-curl-perl/t/19multi.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libwww-curl-perl/t/19multi.t?rev=65373&op=diff
==============================================================================
--- trunk/libwww-curl-perl/t/19multi.t (original)
+++ trunk/libwww-curl-perl/t/19multi.t Sun Nov 28 21:13:56 2010
@@ -2,7 +2,7 @@
use strict;
use warnings;
-use Test::More tests => 16;
+use Test::More tests => 20;
use WWW::Curl::Easy;
use WWW::Curl::Multi;
use File::Temp qw/tempfile/;
@@ -38,11 +38,13 @@
$curl->setopt( CURLOPT_URL, $url);
ok(! $curl->setopt(CURLOPT_WRITEHEADER, $header), "Setting CURLOPT_WRITEHEADER");
ok(! $curl->setopt(CURLOPT_WRITEDATA,$body), "Setting CURLOPT_WRITEDATA");
+ ok(! $curl->setopt(CURLOPT_PRIVATE,"foo"), "Setting CURLOPT_PRIVATE");
my $curl2 = new WWW::Curl::Easy;
$curl2->setopt( CURLOPT_URL, $url);
ok(! $curl2->setopt(CURLOPT_WRITEHEADER, $header2), "Setting CURLOPT_WRITEHEADER");
ok(! $curl2->setopt(CURLOPT_WRITEDATA,$body2), "Setting CURLOPT_WRITEDATA");
+ ok(! $curl2->setopt(CURLOPT_PRIVATE,42), "Setting CURLOPT_PRIVATE");
my $curlm = new WWW::Curl::Multi;
my @fds = $curlm->fdset;
@@ -63,7 +65,15 @@
$curlm->perform;
@fds = $curlm->fdset;
ok( @{$fds[0]} + @{$fds[1]} == 2, "The read or write fdset contains two fds");
- while ($curlm->perform) {
+ my $active = 2;
+ while ($active != 0) {
+ my $ret = $curlm->perform;
+ if ($ret != $active) {
+ while (my ($id,$value) = $curlm->info_read) {
+ ok($id eq "foo" || $id == 42, "The stored private value matches what we set");
+ }
+ $active = $ret;
+ }
action_wait($curlm);
}
@fds = $curlm->fdset;
Modified: trunk/libwww-curl-perl/template/Easy.pm.tmpl
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libwww-curl-perl/template/Easy.pm.tmpl?rev=65373&op=diff
==============================================================================
--- trunk/libwww-curl-perl/template/Easy.pm.tmpl (original)
+++ trunk/libwww-curl-perl/template/Easy.pm.tmpl Sun Nov 28 21:13:56 2010
@@ -4,7 +4,7 @@
use warnings;
use Carp;
-our $VERSION = '4.14';
+our $VERSION = '4.15';
use WWW::Curl ();
use Exporter ();
Modified: trunk/libwww-curl-perl/template/Share.pm.tmpl
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libwww-curl-perl/template/Share.pm.tmpl?rev=65373&op=diff
==============================================================================
--- trunk/libwww-curl-perl/template/Share.pm.tmpl (original)
+++ trunk/libwww-curl-perl/template/Share.pm.tmpl Sun Nov 28 21:13:56 2010
@@ -20,8 +20,8 @@
( my $constname = $AUTOLOAD ) =~ s/.*:://;
my $value = constant( $constname );
- if($!) {
- croak("Undefined subroutine &$AUTOLOAD failed");
+ if ($!) {
+ croak("Undefined subroutine &$AUTOLOAD failed for reasons of $!, constname was $constname, value was: $value");
}
{
More information about the Pkg-perl-cvs-commits
mailing list