ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/AnyEvent-HTTP/HTTP.pm
(Generate patch)

Comparing AnyEvent-HTTP/HTTP.pm (file contents):
Revision 1.97 by root, Tue Jan 18 17:50:20 2011 UTC vs.
Revision 1.99 by root, Fri Jan 28 01:17:25 2011 UTC

713 713
714 my $proxy = $arg{proxy} || $PROXY; 714 my $proxy = $arg{proxy} || $PROXY;
715 my $timeout = $arg{timeout} || $TIMEOUT; 715 my $timeout = $arg{timeout} || $TIMEOUT;
716 716
717 my ($uscheme, $uauthority, $upath, $query, undef) = # ignore fragment 717 my ($uscheme, $uauthority, $upath, $query, undef) = # ignore fragment
718 $url =~ m|(?:([^:/?#]+):)?(?://([^/?#]*))?([^?#]*)(?:(\?[^#]*))?(?:#(.*))?|; 718 $url =~ m|^([^:/?#]+):(?://([^/?#]*))?([^?#]*)(?:(\?[^#]*))?(?:#(.*))?$|;
719 719
720 $uscheme = lc $uscheme; 720 $uscheme = lc $uscheme;
721 721
722 my $uport = $uscheme eq "http" ? 80 722 my $uport = $uscheme eq "http" ? 80
723 : $uscheme eq "https" ? 443 723 : $uscheme eq "https" ? 443
1333snippets. 1333snippets.
1334 1334
1335=head2 HTTP/1.1 FILE DOWNLOAD 1335=head2 HTTP/1.1 FILE DOWNLOAD
1336 1336
1337Downloading files with HTTP can be quite tricky, especially when something 1337Downloading files with HTTP can be quite tricky, especially when something
1338goes wrong and you want tor esume. 1338goes wrong and you want to resume.
1339 1339
1340Here is a function that initiates and resumes a download. It uses the 1340Here is a function that initiates and resumes a download. It uses the
1341last modified time to check for file content changes, and works with many 1341last modified time to check for file content changes, and works with many
1342HTTP/1.0 servers as well, and usually falls back to a complete re-download 1342HTTP/1.0 servers as well, and usually falls back to a complete re-download
1343on older servers. 1343on older servers.

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines