r1645 - packages/libwww-curl-perl/trunk/lib/WWW/Curl

Niko Tyni ntyni-guest at costa.debian.org
Fri Dec 16 20:37:18 UTC 2005


Author: ntyni-guest
Date: 2005-12-16 20:37:17 +0000 (Fri, 16 Dec 2005)
New Revision: 1645

Removed:
   packages/libwww-curl-perl/trunk/lib/WWW/Curl/easy.pm
Log:
Remove leftover lib/WWW/Curl/easy.pm


Deleted: packages/libwww-curl-perl/trunk/lib/WWW/Curl/easy.pm
===================================================================
--- packages/libwww-curl-perl/trunk/lib/WWW/Curl/easy.pm	2005-12-16 20:32:06 UTC (rev 1644)
+++ packages/libwww-curl-perl/trunk/lib/WWW/Curl/easy.pm	2005-12-16 20:37:17 UTC (rev 1645)
@@ -1,459 +0,0 @@
-# Perl interface for libcurl. Check out the file README for more info.
-
-package WWW::Curl::easy;
-
-use strict;
-use Carp;
-use vars qw($VERSION @ISA @EXPORT @EXPORT_OK $AUTOLOAD);
-
-require WWW::Curl;
-
-require Exporter;
-require AutoLoader;
-
- at ISA = qw(Exporter DynaLoader);
-# Items to export into callers namespace by default. Note: do not export
-# names by default without a very good reason. Use EXPORT_OK instead.
-# Do not simply export all your public functions/methods/constants.
- at EXPORT = qw(
-CURLOPT_
-CURLOPT_AUTOREFERER
-CURLOPT_BUFFERSIZE
-CURLOPT_CAINFO
-CURLOPT_CAPATH
-CURLOPT_CLOSEFUNCTION
-CURLOPT_CLOSEPOLICY
-CURLOPT_CONNECTTIMEOUT
-CURLOPT_COOKIE
-CURLOPT_COOKIEFILE
-CURLOPT_COOKIEJAR
-CURLOPT_COOKIESESSION
-CURLOPT_CRLF
-CURLOPT_CUSTOMREQUEST
-CURLOPT_DEBUGDATA
-CURLOPT_DEBUGFUNCTION
-CURLOPT_DNS_CACHE_TIMEOUT
-CURLOPT_DNS_USE_GLOBAL_CACHE
-CURLOPT_EGDSOCKET
-CURLOPT_ENCODING
-CURLOPT_ERRORBUFFER
-CURLOPT_FAILONERROR
-CURLOPT_FILE
-CURLOPT_FILETIME
-CURLOPT_FOLLOWLOCATION
-CURLOPT_FORBID_REUSE
-CURLOPT_FRESH_CONNECT
-CURLOPT_FTPAPPEND
-CURLOPT_FTPASCII
-CURLOPT_FTPLISTONLY
-CURLOPT_FTPPORT
-CURLOPT_FTP_CREATE_MISSING_DIRS
-CURLOPT_FTP_RESPONSE_TIMEOUT
-CURLOPT_FTP_SSL
-CURLOPT_FTP_USE_EPRT
-CURLOPT_FTP_USE_EPSV
-CURLOPT_HEADER
-CURLOPT_HEADERFUNCTION
-CURLOPT_HTTP200ALIASES
-CURLOPT_HTTPAUTH
-CURLOPT_HTTPGET
-CURLOPT_HTTPHEADER
-CURLOPT_HTTPPOST
-CURLOPT_HTTPPROXYTUNNEL
-CURLOPT_HTTPREQUEST
-CURLOPT_HTTP_VERSION
-CURLOPT_INFILE
-CURLOPT_INFILESIZE
-CURLOPT_INFILESIZE_LARGE
-CURLOPT_INTERFACE
-CURLOPT_IPRESOLVE
-CURLOPT_KRB4LEVEL
-CURLOPT_LOW_SPEED_LIMIT
-CURLOPT_LOW_SPEED_TIME
-CURLOPT_MAXCONNECTS
-CURLOPT_MAXFILESIZE
-CURLOPT_MAXFILESIZE_LARGE
-CURLOPT_MAXREDIRS
-CURLOPT_MUTE
-CURLOPT_NETRC
-CURLOPT_NETRC_FILE
-CURLOPT_NOBODY
-CURLOPT_NOPROGRESS
-CURLOPT_NOSIGNAL
-CURLOPT_NOTHING
-CURLOPT_PASSWDDATA
-CURLOPT_PASSWDFUNCTION
-CURLOPT_PORT
-CURLOPT_POST
-CURLOPT_POSTFIELDS
-CURLOPT_POSTFIELDSIZE
-CURLOPT_POSTQUOTE
-CURLOPT_PREQUOTE
-CURLOPT_PRIVATE
-CURLOPT_PROGRESSDATA
-CURLOPT_PROGRESSFUNCTION
-CURLOPT_PROXY
-CURLOPT_PROXYAUTH
-CURLOPT_PROXYPORT
-CURLOPT_PROXYTYPE
-CURLOPT_PROXYUSERPWD
-CURLOPT_PUT
-CURLOPT_QUOTE
-CURLOPT_RANDOM_FILE
-CURLOPT_RANGE
-CURLOPT_READFUNCTION
-CURLOPT_REFERER
-CURLOPT_RESUME_FROM
-CURLOPT_RESUME_FROM_LARGE
-CURLOPT_SHARE
-CURLOPT_SSLCERT
-CURLOPT_SSLCERTPASSWD
-CURLOPT_SSLCERTTYPE
-CURLOPT_SSLENGINE
-CURLOPT_SSLENGINE_DEFAULT
-CURLOPT_SSLKEY
-CURLOPT_SSLKEYPASSWD
-CURLOPT_SSLKEYTYPE
-CURLOPT_SSLVERSION
-CURLOPT_SSL_CIPHER_LIST
-CURLOPT_SSL_CTX_DATA
-CURLOPT_SSL_CTX_FUNCTION
-CURLOPT_SSL_VERIFYHOST
-CURLOPT_SSL_VERIFYPEER
-CURLOPT_STDERR
-CURLOPT_TELNETOPTIONS
-CURLOPT_TIMECONDITION
-CURLOPT_TIMEOUT
-CURLOPT_TIMEVALUE
-CURLOPT_TRANSFERTEXT
-CURLOPT_UNRESTRICTED_AUTH
-CURLOPT_UPLOAD
-CURLOPT_URL
-CURLOPT_USERAGENT
-CURLOPT_USERPWD
-CURLOPT_VERBOSE
-CURLOPT_WRITEFUNCTION
-CURLOPT_WRITEHEADER
-CURLOPT_WRITEINFO
-CURLINFO_CONNECT_TIME
-CURLINFO_CONTENT_LENGTH_DOWNLOAD
-CURLINFO_CONTENT_LENGTH_UPLOAD
-CURLINFO_CONTENT_TYPE
-CURLINFO_DATA_IN
-CURLINFO_DATA_OUT
-CURLINFO_EFFECTIVE_URL
-CURLINFO_END
-CURLINFO_FILETIME
-CURLINFO_HEADER_IN
-CURLINFO_HEADER_OUT
-CURLINFO_HEADER_SIZE
-CURLINFO_HTTPAUTH_AVAIL
-CURLINFO_HTTP_CODE
-CURLINFO_HTTP_CONNECTCODE
-CURLINFO_LASTONE
-CURLINFO_NAMELOOKUP_TIME
-CURLINFO_NONE
-CURLINFO_PRETRANSFER_TIME
-CURLINFO_PRIVATE
-CURLINFO_PROXYAUTH_AVAIL
-CURLINFO_REDIRECT_COUNT
-CURLINFO_REDIRECT_TIME
-CURLINFO_REQUEST_SIZE
-CURLINFO_RESPONSE_CODE
-CURLINFO_SIZE_DOWNLOAD
-CURLINFO_SIZE_UPLOAD
-CURLINFO_SPEED_DOWNLOAD
-CURLINFO_SPEED_UPLOAD
-CURLINFO_SSL_VERIFYRESULT
-CURLINFO_STARTTRANSFER_TIME
-CURLINFO_TEXT
-CURLINFO_TOTAL_TIME
-USE_INTERNAL_VARS
-);
-
-$VERSION = '2.0';
-
-
-$WWW::Curl::easy::headers = "";
-$WWW::Curl::easy::content = "";
-
-sub AUTOLOAD {
-    # This AUTOLOAD is used to 'autoload' constants from the constant()
-    # XS function.
-
-    (my $constname = $AUTOLOAD) =~ s/.*:://;
-    return constant($constname, 0);
-}
-
-# bootstrap WWW::Curl::easy $VERSION;
-
-# Preloaded methods go here.
-
-# Autoload methods go after __END__, and are processed by the autosplit program.
-
-1;
-__END__
-# Below is the documentation.
-
-=cut 
-
-=head1 NAME
-
-WWW::Curl::easy - Perl extension interface for libcurl
-
-=head1 SYNOPSIS
-
-	use WWW::Curl::easy;
- 
-	my $curl = WWW::Curl::easy->new(); # an alias for WWW::Curl::easy::init
-	my $code = $curl->setopt(CURLOPT_option, ....);
-	   $code = $curl->perform($curl);
-	my $err = $curl->errbuf; # report any error message
-	my $info = $curl->getinfo(CURLINFO_option);
-
-	$curl->cleanup(); # optional
-
-	WWW::Curl::easy::global_cleanup(); # optional cleanup at exit
-
-Read the curl man pages, curl_easy_setopt(3) and curl_easy_getinfo(3) for details of CURLOPT_option and CURLINFO_option values.
-
-=head1 DESCRIPTION
- 
-B<WWW::Curl::easy> provides an interface to the libcurl C library. See
-http://curl.haxx.se/ for more information on cURL and libcurl.
-
-Before v2.0, this modules was called 'Curl::easy'. The name has changed to 'WWW::Curl::easy' (to better suit
-CPAN naming guidelines). The new version includes a compatability package, so existing scripts
-using the 'Curl::easy' name will continue to work as before. New scripts should use the 
-'WWW::Curl::easy' name.
-
-From v1.30, this interface supports the perl OO style of creating
-$curl handles, and calling methods to get and set curl parameters. Previous
-versions of this interface only supported the straight 'subroutine' call style
-of accessing curl. Scripts using the older style are still compatible (but see
-COMPATABILITY, below), but this documentation and the test scripts have been
-updated to the OO style.
-
-=head2 FILES and CALLBACKS
-
-WWW::Curl::easy supports the various options of curl_easy_setopt which require either a FILE * or
-a callback (subroutine) reference.
-
-Callback to perl subroutines are handled by this XS interface through a wrapper which takes
-care of converting from C to perl variables and back again. This wrapper also simplifies some
-'C' style arguments to make them behave in a more 'perl' like manner. In particular, the
-read and write callbacks do not look just like the 'fread' and 'fwrite' C functions -
-perl variables do not need separate length parameters, and perl functions can return a list of
-variables, instead of needing a pointer to modify. The details are described below.
-
-=head2 C<FILE *> handles (GLOBS)
- 
-Curl options which take a C<FILE *>, such as C<CURLOPT_FILE>, C<CURLOPT_WRITEHEADER>,
-C<CURLOPT_INFILE>
-can be passed a perl file handle:
- 
-	open BODY,">body.out";
-	$code = $curl->setopt(CURLOPT_FILE, *BODY);
-
-=head2 WRITE callback
-
-The C<CUROPT_WRITEFUNCTION> option may be set which will cause libcurl to call back to
-the referenced perl subroutine:
-
-	sub chunk { my ($data,$pointer)=@_; ...do something...; return length($data) }
-
-	# call the above routine from curl:
-	$code = $curl->setopt(CURLOPT_WRITEFUNCTION, \&chunk );
-	$code = $curl->setopt(CURLOPT_FILE, \$variable );
-	$curl->perform();
-
-The subroutine will be passed whatever is defined by C<CURLOPT_FILE>. This can be
-a reference to a regular variable (as above), or a glob or anything else you like.
-
-The callback function must return the number of bytes 'handled' ( C<length($data)> ) or
-the transfer will abort. A transfer can be aborted by returning a value of 0, for example.
-
-The option C<CURLOPT_WRITEHEADER> can be set to pass a different C<$pointer> into the
-CURLOPT_WRITEFUNCTION for header values. This lets you collect the headers and body separately, as
-shown in the example below:
-
-    use WWW::Curl::easy;
-    my $headers="";
-    my $body="";
-    sub chunk { my ($data,$pointer)=@_; ${$pointer}.=$data; return length($data) }
-
-    my $curl=WWW::Curl::easy->new;
-    ...
-    my $code = $curl->setopt(CURLOPT_WRITEFUNCTION, \&chunk );
-       $code = $curl->setopt(CURLOPT_WRITEHEADER, \$headers );
-       $code = $curl->setopt(CURLOPT_FILE, \$body );
-    $curl->perform();
-    print $body;
-
-If you have libcurl > 7.7.1, then you could instead set C<CURLOPT_HEADERFUNCTION> to a different
-callback, and have the header collected that way.
-
-=head2 READ callback
-
-WWW::Curl::easy supports C<CURLOPT_READFUNCTION>. This function should follow this prototype:
-
-	sub read_callback {
-	    my ($maxlength,$pointer)=@_;
-		....
-            return $data;
-	}
-
-The subroutine must return an empty string "" at the end of the data. Note that this function
-isn't told how much data to provide - $maxlength is just the maximum size of the buffer
-provided by libcurl. If you are doing an HTTP POST or PUT for example, it is important that this
-function only returns (in total) as much data as the 'Content-Length' header specifies, followed by
-a an empty (0 length) buffer.
-
-=head2 PROGRESS callback
-
-WWW::Curl::easy supports C<CURLOPT_PROGRESSFUNCTION>. This function should follow this prototype:
-
-	sub progress_callback {
-	    my ($clientp,$dltotal,$dlnow,$ultotal,$ulnow)=@_;
-		....
-	    return 0;
-	}                        
-
-The function should return 0 normally, or -1 which will abort/cancel the
-transfer. C<$clientp> is whatever is set using the C<CURLOPT_PROGRESSDATA> option.
-
-=head2 PASSWD callback
-
-WWW::Curl::easy supports C<CURLOPT_PASSWDFUNCTION>. This function should look something like this:
- 
-	sub passwd_callback {
-	    my ($clientp,$prompt,$buflen)=@_;
-		...
-	    return (0,$data);
-	}                    
-
-C<$clientp> is whatever scalar is set using the C<CURLOPT_PASSWDDATA> option.
-C<$prompt> is a text string which can be used to prompt for a password.
-C<$buflen> is the maximum length of the accepted password reply.
-
-The function must return 0 (for 'OK') and the password data as a list.
-Return (-1,"") to indicate an error.
-
-=head2 STDERR redirection
-
-You can use set the option C<CURLOPT_STDERR> to an alternate file handle glob
-to redirect stderr messages from libcurl, if your libcurl version has this option.
-
-	open(OTHERFILE,">/dev/null") or die;
- 	$curl->setopt(CURLOPT_STDERR,*OTHERFILE);
-
-=head1 COMPATABILITY NOTES
-
-As noted in the introduction, this module was previously called 'Curl::easy', and has
-been renamed for upload to CPAN as 'WWW::Curl'. Scripts should use the 'WWW:Curl::easy' functions
-for access basic libcurl functions. At some point, a 'higher level' perl interface is intended to become
-'WWW::Curl', and act as a wrapper around WWW::Curl::easy, with more perl-like defaults and interface
-syntax.
-
-=item *
-
-=over 4
-
-Early releases of this module didn't reliably deal with more than a single
-curl handle per process, because of the use of a number of global 'glue' variables
-in various places. This should now be fixed, but certain interface features could not
-be made reliably forward compatible if you intend to use multiple handles or threading:
-
-=over 4
-
-=item *
-
-The (largely undocumented) USE_INTERNAL_VARS feature, which previously collected data in a
-static global buffer, has been ported to use the new threadable structure, but
-the method by which it returns it's output (directly into specific global variables)
-cannot be made safe without destroying backwards compatibility. The interface is considered
-DEPRECATED in this release, and will be removed *VERY SOON* - instead, use a perl subroutine
-callback to collect output into a string (as shown in the example above), which should be safe
-across multiple threads/handles.
-
-=item *
-
-You can build this module without the USE_INTERNAL_VARS interface by compiling with
--UWITH_INTERNAL_VARS. This will become the default in a future release.
-
-=back
-
-=item *
-
-Returning the error buffer by passing the name of a perl variable through C<$curl-E<gt>setopt>
-is ugly.  It is still supported, but instead, you can get the information by calling the new method
-C<$curl->errbuf> directly.
-
-=item *
-
-Returning CURLINFO variables by passing the output variable to C<$curl-E<gt>getinfo> is ugly.
-It is still supported, but instead, you can get the information as the return value from
-getinfo. Instead of:
-
-	my $bytes;
-	WWW::Curl::easy::getinfo($curl, CURLINFO_SIZE_DOWNLOAD, $bytes);
-
-use:
-	my $bytes=$curl->getinfo(CURLINFO_SIZE_DOWNLOAD);
-
-
-=item *
-
-C<$curl-E<gt>cleanup> ( WWW::Curl::easy::cleanup($curl) ) no longer actually does anything. Curl
-handles will be automatically cleaned up by perl when they are no longer used.
-
-=item *
-
-curl_global_init is now explicitly called when the module is first loaded, rather than relying on
-it hapenning during the first call to curl_easy_init. This should eliminate the chance of a race if
-creating two handles simultaneously. (E.g. using perl ithreads).
-
-=item *
-
-curl_global_cleanup is not called automatically when perl or the module shuts down, as there
-doesn't seem an easy way to arrange this in perl-XS (suggestions welcome). You can call curl 
-global cleanup explicitly (if you care) by calling the class method WWW::Curl::easy::global_cleanup .
-Don't call any other curl functions afterwards!
-
-=head1 KNOWN BUGS
-
-There seems to be a slow leak of a few bytes each time a WWW::Curl::easy handle is created and
-destroyed (despite careful cleanup efforts) at least when testing with libcurl-7.9.8.
-Hopefully this will be fixed in a future release.
-
-Also note the above problems with the USE_INTERNAL_VARS interface.
-
-=head1 AUTHOR
-
-Version 2.00 of WWW::Curl::easy is a renaming of the previous version (named Curl::easy),
-to follow CPAN naming guidelines, by Cris Bailiff.
-
-Versions 1.30, a (hopefully) threadable, object-oriented, multiple-callback compatible
-version of Curl::easy was substantially reworked from the previous Curl::easy
-release (1.21) by Cris Bailiff.
-
-Original Author Georg Horn <horn at koblenz-net.de>, with additional callback, pod
-and test work by Cris Bailiff <c.bailiff+curl at devsecure.com> and Forrest Cahoon
-<forrest.cahoon at merrillcorp.com>
-
-Currently maintained by Cris Bailiff <c.bailiff+curl at devsecure.com>
-
-=head1 Copyright
-
-Copyright (C) 2000,2001,2002,2003 Daniel Stenberg, Cris Bailiff, et al.
- 
-You may opt to use, copy, modify, merge, publish, distribute and/or sell
-copies of the Software, and permit persons to whom the Software is furnished
-to do so, under the terms of the MPL or the MIT/X-derivate licenses. You may
-pick one of these licenses.
-
-=head1 SEE ALSO
-
-http://curl.haxx.se/
-
-




More information about the Pkg-perl-cvs-commits mailing list