debian/0000775000000000000000000000000012057637477007212 5ustar debian/copyright0000664000000000000000000002675312057637420011146 0ustar This package was debianized by Robert Lemmen on Mon, 15 Nov 2004 12:56:46 +0100. It was downloaded from http://zsync.moria.org.uk/ Copyright: zsync is based on the rsync algorithm, by Andrew Tridgell. zsync also uses a large part of zlib - this code, in the zlib subdirectory, is copyright 1995-2003 Jean-loup Gailly and Mark Adler, see zlib/README for details. zlib also includes checksum code taken from OpenBSD. The MD4 code is public domanain, by Colin Plumb and Todd C. Miller. The SHA1 code is also public domain, by Steve Reid. This code is in the libhash/ subdirectory, see the individual files for their non-copyright notices. The rest of the code (that is, everything not in the zlib and libhash subdirectories) is copyright (C) 2004 Colin Phipps . Upstream Author: Colin Phipps License: The Artistic License Version 2.0beta4, October 2000 Copyright (C) 2000, Larry Wall. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble This copyright license states the terms under which a given free software Package may be copied, modified and/or redistributed, while the Originator(s) maintain some artistic control over the future development of that Package (at least as much artistic control as can be given under copyright law while still making the Package open source and free software). This license is bound by copyright law, and thus it legally applies only to works which the copyright holder has permitted copying, distribution or modification under the terms of the Artistic License, Version 2.0. You are reminded that You are always permitted to make arrangements wholly outside of a given copyright license directly with the copyright holder(s) of a given Package. If the terms of this license impede your ability to make full use of the Package, You are encouraged to contact the copyright holder(s) and seek a different licensing arrangement. Definitions "Package" refers to the collection of files distributed by the Originator(s), and derivatives of that collection of files created through textual modification. "Standard Version" refers to the Package if it has not been modified, or has been modified only in ways suggested by the Originator(s). "Modified Version" refers to the Package, if it has been changed by You via textual modification of the source code, and such changes were not suggested by the Originator(s). "Originator" refers to the author(s) and/or copyright holder(s) of the Standard Version of the Package. "You" and "Your" refers to any person who would like to copy, distribute, or modify the Package. "Distribution Fee" is any fee that You charge for providing a copy of this Package to another party. It does not refer to licensing fees. "Freely Available" means that: (a) no fee is charged for the right to use the item (though a Distribution Fee may be charged). (b) recipients of the item may redistribute it under the same conditions they received it. (c) If the item is a binary, object code, bytecode, the complete corresponding machine-readable source code is included with the item. Permission for Use and Modification Without Redistribution (1) You are permitted to use the Standard Version and create and use Modified Versions for any purpose without restriction, provided that you do not redistribute the Modified Version to others outside of your company or organization. Permissions for Redistribution of the Standard Version (2) You may make available verbatim copies of the source code of the Standard Version of this Package in any medium without restriction, either gratis or for a Distribution Fee, provided that you duplicate all of the original copyright notices and associated disclaimers. At Your discretion, such verbatim copies may or may not include compiled bytecode, object code or binary versions of the corresponding source code in the same medium. (3) You may apply any bug fixes, portability changes, and other modifications made available from any of the Originator(s). The resulting modified Package will still be considered the Standard Version, and may be copied, modified and redistributed under the terms of the original license of the Standard Version as if it were the Standard Version. Permissions for Redistribution of Modified Versions of the Package as Source (4) You may modify your copy of the source code of this Package in any way and distribute that Modified Version (either gratis or for a Distribution Fee, and with or without a corresponding binary, bytecode or object code version of the Modified Version) provided that You clearly indicate what changes You made to the Package, and provided that You do at least ONE of the following: (a) make the Modified Version available to the Originator(s) of the Standard Version, under the exact license of the Standard Version, so that the Originator(s) may include your modifications into the Standard Version (at their discretion). (b) modify any installation scripts and procedures so that installation of the Modified Version will never conflict with an installation of the Standard Version, include for each program installed by the Modified Version clear documentation describing how it differs from the Standard Version, and rename your Modified Version so that the name is substantially different from the Standard Version. (c) permit and encourage anyone who receives a copy of the Modified Version permission to make your modifications Freely Available in some specific way. If Your Modified Version is in turn derived from a Modified Version made by a third party, then You are still required to ensure that Your Modified Version complies with the requirements of this license. Permissions for Redistribution of Non-Source Versions of Package (5) You may distribute binary, object code, bytecode or other non-source versions of the Standard Version of the Package, provided that you include complete instructions on where to get the source code of the Standard Version. Such instructions must be valid at the time of Your distribution. If these instructions, at any time while You are carrying our such distribution, become invalid, you must provide new instructions on demand or cease further distribution. If You cease distribution within thirty days after You become aware that the instructions are invalid, then You do not forfeit any of Your rights under this license. (6) You may distribute binary, object code, bytecode or other non-source versions of a Modified Version provided that You do at least ONE of the following: (a) include a copy of the corresponding source code for the Modified Version under the terms indicated in (4). (b) ensure that the installation of Your non-source Modified Version does not conflict in any way with an installation of the Standard Version, include for each program installed by the Modified Version clear documentation describing how it differs from the Standard Version, and rename your Modified Version so that the name is substantially different from the Standard Version. (c) ensure that the Modified Version includes notification of the changes made from the Standard Version, and offer to provide machine-readable source code (under a license that permits making that source code Freely Available) of the Modified Version via mail order. Permissions for Inclusion of the Package in Aggregate Works (7) You may aggregate this Package (either the Standard Version or Modified Version) with other packages and distribute the resulting aggregation provided that You do not charge a licensing fee for the Package. Distribution Fees are permitted, and licensing fees for other packages in the aggregation are permitted. Your permission to distribute Standard or Modified Versions of the Package is still subject to the other terms set forth in other sections of this license. (8) In addition to the permissions given elsewhere by this license, You are also permitted to link Modified and Standard Versions of this Package with other works and distribute the result without restriction, provided You have produced binary program(s) that do not overtly expose the interfaces of the Package. This includes permission to embed the Package in a larger work of your own without exposing a direct interface to the Package. This also includes permission to build stand-alone binary or bytecode versions of your scripts that require the Package, but do not otherwise give the casual user direct access to the Package itself. Items That are Never Considered Part of a Modified Version Package (9) Works (including, but not limited to, subroutines and scripts) that you have linked or aggregated with the Package that merely extend or make use of the Package, but are not intended to cause the Package to operate differently from the Standard Version, do not, by themselves, cause the Package to be a Modified Version. In addition, such works are not considered parts of the Package itself, and are not bound by the terms of the Package's license. Acceptance of License and Disclaimer of Warranty (10) You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to copy, modify or distribute the Standard or Modified Versions of the Package. These actions are prohibited by copyright law if you do not accept this License. Therefore, by copying, modifying or distributing Standard and Modified Versions of the Package, you indicate your acceptance of the license of the Package. (11) Disclaimer of Warranty: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT UNLESS REQUIRED BY LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER OR CONTRIBUTOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. debian/changelog0000664000000000000000000002212212057637420011047 0ustar zsync (0.6.2-1ubuntu1) raring; urgency=low * Merge from Debian unstable. Remaining changes: - clienthttp.diff: + client.c, http.c: Add an offset field ("O"), wanted for apt-zsync because we want to step past the first members in the .deb archive + client.c: Print progress even if output is not a tty. This makes it possible to gather statistics for an experimental apt-get method. + http.c: use off_t instead of size_t where appropriate, for 64-bit cleanness -- Logan Rosen Mon, 26 Nov 2012 16:21:07 -0500 zsync (0.6.2-1) unstable; urgency=low * New upstream release (closes: #532818) * Convert to quilt format -- Robert Lemmen Thu, 31 May 2012 20:54:47 +0100 zsync (0.6.1-3ubuntu1) natty; urgency=low * Merge from Debian Unstable, remaining changes: - client.c, http.c: + Add an offset field ("O"), wanted for apt-zsync because we want to step past the first members in the .deb archive - client.c: + Print progress even if output is not a tty. This makes it possible to gather statistics for an experimental apt-get method. - http.c: + use off_t instead of size_t where appropriate, for 64-bit cleanness * Dropped changes: - libzsync/zsync.c: Ubuntu change checked for updates for package sladen-aptsync rather than this package itself. This change wasn't documented in any changelog, nor could I find a debian/ubuntu bug on this issue. -- Bilal Akhtar Tue, 09 Nov 2010 16:04:03 +0300 zsync (0.6.1-3) unstable; urgency=low * Something seems to have gone in 0.6.1-2, apply the patch for real this time -- Robert Lemmen Wed, 30 Jun 2010 10:50:26 +0100 zsync (0.6.1-2) unstable; urgency=low * Applied patch for LFS support (closes: #562673) -- Robert Lemmen Tue, 23 Mar 2010 09:59:09 +0000 zsync (0.6.1-1ubuntu1) lucid; urgency=low * Merge from Debian testing, remaining changes: - client.c, http.c, make.c, libzsync/zsync.c: + Add an offset field ("O"), wanted for apt-zsync because we want to step past the first members in the .deb archive - client.c: + Print progress even if output is not a tty. This makes it possible to gather statistics for an experimental apt-get method. - debian/rules: build with $(shell getconf LFS_CFLAGS), so that we can handle files over 2GB (such as DVD images) on 32-bit systems. - http.c: + use off_t instead of size_t where appropriate, for 64-bit cleanness - libzsync/zsync.c: + Use atoll() instead of atol(), to ensure support for > 32bit file sizes. + Cast to off_t before multiplying, otherwise we get random overflowage on the byte range. * Dropped changes: - make.c: don't force guess_gzip_options() to always return --best; this change is undocumented and I can't figure out why it's needed. -- Steve Langasek Fri, 25 Dec 2009 08:29:48 +0000 zsync (0.6.1-1) unstable; urgency=low * New upstream release (closes: #444159, #469919) -- Robert Lemmen Wed, 03 Jun 2009 20:19:00 +0100 zsync (0.6-1ubuntu4) karmic-proposed; urgency=low * http.c: range_fetch->block_left must also be off_t, not size_t. -- Steve Langasek Sat, 07 Nov 2009 12:59:40 +0000 zsync (0.6-1ubuntu3) karmic-proposed; urgency=low * debian/rules: build with $(shell getconf LFS_CFLAGS), so that we can handle files over 2GB (such as DVD images) on 32-bit systems. LP: #412413. * http.c: - drop local delta, not needed if we use LFS_CFLAGS - fix ETA calculation on the progress bar * libzsync/zsync.c: - Use atoll() instead of atol(), to ensure support for > 32bit file sizes. - Cast to off_t before multiplying, otherwise we get random overflowage on the byte range. -- Steve Langasek Thu, 05 Nov 2009 08:54:51 +0000 zsync (0.6-1ubuntu2) karmic; urgency=low * http.c: fixup offsets that are larger than signed ints (LP: #420931) -- Steve Beattie Mon, 31 Aug 2009 02:14:24 -0700 zsync (0.6-1ubuntu1) karmic; urgency=low * Merge with Debian unstable (LP: #301291). Remaining changes: - client.c, http.c, make.c, libzsync/zsync.c: + Add an offset field ("O"). - client.c: + Print progress even if output is not a tty. This makes it possible to gather statistics for an experimental apt-get method. -- Siegfried-Angel Gevatter Pujals Thu, 30 Apr 2009 20:32:06 +0200 zsync (0.6-1) unstable; urgency=low * New upstream release -- Robert Lemmen Tue, 10 Feb 2009 10:44:19 +0000 zsync (0.5-2) unstable; urgency=low * Fixed manual page ordering (closes: #402795) * Support for GNU --long options (closes: #402796) -- Robert Lemmen Wed, 29 Aug 2007 13:18:58 +0200 zsync (0.5-1ubuntu3) hardy; urgency=low * Modify Maintainer value to match the DebianMaintainerField specification (LP: #176738). -- Siegfried-Angel Gevatter Pujals (RainCT) Sun, 16 Dec 2007 19:37:31 +0100 zsync (0.5-1ubuntu2) feisty; urgency=low * print progress even if output is not a tty. This makes it possible to gather statistics for a experimental apt-get method -- Michael Vogt Mon, 26 Feb 2007 13:54:45 +0100 zsync (0.5-1ubuntu1) feisty; urgency=low * Merge from debian unstable. * http.c: changed off64_t to off_t * Remaining Changes: - Fix offset field so that a download of an odd number of bytes is possible. - Bugfixes for apt-sync. - Add an offset field. -- Stephan Hermann Thu, 21 Dec 2006 16:12:20 +0100 zsync (0.5-1) unstable; urgency=low * New upstream release -- Robert Lemmen Sat, 7 Oct 2006 14:55:00 +0200 zsync (0.4.3-1ubuntu1) edgy; urgency=low * Merge from debian unstable. Remaining changes: - Fix offset field so that a download of an odd number of bytes is possible. - Bugfixes for apt-sync. - Add an offset field. -- William Alexander Grant Mon, 11 Sep 2006 22:04:41 +1000 zsync (0.4.3-1) unstable; urgency=low * New upstream release -- Robert Lemmen Tue, 25 Jul 2006 10:59:24 +0200 zsync (0.4.2-1ubuntu1) edgy; urgency=low [Felix Feyertag] * Fix offset field so that download of odd number of bytes is possible. * Bugfixes for apt-sync [Paul Sladen] * Add an offset field -- Michael Vogt Thu, 7 Sep 2006 11:06:14 +0200 zsync (0.4.2-1) unstable; urgency=low * New upstream release -- Robert Lemmen Tue, 18 Oct 2005 10:55:19 +0200 zsync (0.4.1-1) unstable; urgency=low * New upstream release (closes: #318759) -- Robert Lemmen Mon, 18 Jul 2005 14:33:23 +0200 zsync (0.4.0-2) unstable; urgency=low * Security update for CAN-2005-2096 -- Robert Lemmen Mon, 11 Jul 2005 19:57:42 +0200 zsync (0.4.0-1) unstable; urgency=low * New upstream release (closes: #306557) -- Robert Lemmen Wed, 18 May 2005 11:31:03 +0200 zsync (0.3.3-1) unstable; urgency=low * New upstream release (closes: #301209) -- Robert Lemmen Sun, 27 Mar 2005 16:10:09 +0200 zsync (0.3.0-1) unstable; urgency=low * New upstream release -- Robert Lemmen Mon, 14 Mar 2005 17:43:45 +0100 zsync (0.2.3-1) unstable; urgency=low * New upstream release (closes: #295410) -- Robert Lemmen Sat, 19 Feb 2005 15:59:20 +0100 zsync (0.2.2-1) unstable; urgency=low * New upstream release -- Robert Lemmen Sun, 13 Feb 2005 18:46:19 +0100 zsync (0.2.1-1) unstable; urgency=low * New upstream release -- Robert Lemmen Wed, 9 Feb 2005 15:54:55 +0100 zsync (0.2.0-1) unstable; urgency=low * New upstream release (closes: #289427) -- Robert Lemmen Mon, 7 Feb 2005 16:25:52 +0100 zsync (0.1.6-1) unstable; urgency=low * New upstream release (closes: #289424, #289427) -- Robert Lemmen Sat, 15 Jan 2005 18:03:37 +0100 zsync (0.1.5-1) unstable; urgency=low * New upstream release -- Robert Lemmen Wed, 22 Dec 2004 15:35:41 +0100 zsync (0.1.4-1) unstable; urgency=low * New upstream release -- Robert Lemmen Tue, 14 Dec 2004 20:49:08 +0100 zsync (0.1.3-1) experimental; urgency=low * New upstream release -- Robert Lemmen Sun, 12 Dec 2004 18:42:16 +0100 zsync (0.1.2-1) experimental; urgency=low * New upstream release -- Robert Lemmen Tue, 7 Dec 2004 19:19:46 +0100 zsync (0.1.0-1) experimental; urgency=low * Initial release. (closes: #279551) -- Robert Lemmen Mon, 15 Nov 2004 12:56:46 +0100 debian/rules0000775000000000000000000000032312057637420010254 0ustar #!/usr/bin/make -f # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 override_dh_auto_configure: dh_auto_configure -- $(shell dpkg-buildflags --export=configure) %: dh $@ --with autotools-dev debian/source/0000775000000000000000000000000012057637475010510 5ustar debian/source/format0000664000000000000000000000001412057637420011704 0ustar 3.0 (quilt) debian/control0000664000000000000000000000203412057637420010600 0ustar Source: zsync Section: net Priority: optional Maintainer: Ubuntu Developers XSBC-Original-Maintainer: Robert Lemmen Build-Depends: debhelper (>= 8.0.0), autotools-dev Standards-Version: 3.9.2 Homepage: http://zsync.moria.org.uk/ Package: zsync Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} Description: client-side implementation of the rsync algorithm zsync is a file transfer program to download files from remote web servers. If a previous version of a file is available locally, zsync will only download changed parts and hereby minimise the download volume. The algorithm is the same as used by rsync(1), but zsync does not require any server software (apart from a web server), nor does it need shell access. Instead, it uses a control file (.zsync file) that describes the file to be downloaded, which it uses to determine the blocks to fetch. This file is created once on the server (and not for each request) and sits next to actual file to download debian/zsync.lintian-overrides0000664000000000000000000000030312057637420013720 0ustar # this is ok for zsync as it heavily modifies zlib in ways that are not # appropriate for the real one zsync: embedded-library usr/bin/zsync: zlib zsync: embedded-library usr/bin/zsyncmake: zlib debian/compat0000664000000000000000000000000212057637420010374 0ustar 8 debian/watch0000664000000000000000000000041712057637420010231 0ustar # Example watch control file for uscan # Rename this file to "watch" and then you can run the "uscan" command # to check for upstream updates and more. # Site Directory Pattern Version Script version=3 http://zsync.moria.org.uk/downloads download/zsync-(.*)\.tar\..* debian/docs0000664000000000000000000000001412057637420010044 0ustar NEWS README debian/patches/0000775000000000000000000000000012057637475010637 5ustar debian/patches/manpages.diff0000664000000000000000000000121312057637420013247 0ustar --- a/doc/zsync.1 +++ b/doc/zsync.1 @@ -22,7 +22,7 @@ \fB\-A\fR \fIhostname\fP=\fIusername\fR:\fIpassword\fR Specifies a username and password to be used with the given hostname. \fB-A\fR can be used multiple times (with different hostnames), in cases where e.g. the -.zsync file is on a different server from the download, or there are multiple + .zsync file is on a different server from the download, or there are multiple download servers (there could be different auth details for different servers - and zsync never assumes that your password should be sent to a server other than the one named - otherwise redirects would be dangerous!). debian/patches/buildsystem.diff0000664000000000000000000000221712057637420014025 0ustar --- a/Makefile.am +++ b/Makefile.am @@ -27,8 +27,8 @@ $(ac_aux_dir)/sockinttypes.m4 docdir=$(prefix)/share/doc/@PACKAGE@ -doc_DATA = COPYING README -EXTRA_DIST = INSTALL README COPYING $(AUX_DIST_GEN) check-zsyncmake +doc_DATA = README +EXTRA_DIST = INSTALL README $(AUX_DIST_GEN) check-zsyncmake TESTS_ENVIRONMENT = top_builddir=$(top_builddir) TESTS = check-zsyncmake --- a/Makefile.in +++ b/Makefile.in @@ -39,7 +39,7 @@ subdir = . DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(srcdir)/config.h.in \ - $(top_srcdir)/configure COPYING INSTALL NEWS \ + $(top_srcdir)/configure INSTALL NEWS \ autotools/config.guess autotools/config.sub autotools/depcomp \ autotools/install-sh autotools/missing getaddrinfo.c ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 @@ -271,8 +271,8 @@ $(ac_aux_dir)/sockaddrin6.m4 \ $(ac_aux_dir)/sockinttypes.m4 -doc_DATA = COPYING README -EXTRA_DIST = INSTALL README COPYING $(AUX_DIST_GEN) check-zsyncmake +doc_DATA = README +EXTRA_DIST = INSTALL README $(AUX_DIST_GEN) check-zsyncmake TESTS_ENVIRONMENT = top_builddir=$(top_builddir) TESTS = check-zsyncmake all: config.h debian/patches/series0000664000000000000000000000005712057637420012044 0ustar buildsystem.diff manpages.diff clienthttp.diff debian/patches/clienthttp.diff0000664000000000000000000001044512057637420013641 0ustar Description: changes to client.c and http.c in the Ubuntu packaging - client.c, http.c: + Add an offset field ("O"), wanted for apt-zsync because we want to step past the first members in the .deb archive - client.c: + Print progress even if output is not a tty. This makes it possible to gather statistics for an experimental apt-get method. - http.c: + use off_t instead of size_t where appropriate, for 64-bit cleanness --- zsync-0.6.2.orig/client.c +++ zsync-0.6.2/client.c @@ -446,6 +446,9 @@ static int set_mtime(char* filename, tim /**************************************************************************** * * Main program */ + +extern long global_offset; + int main(int argc, char **argv) { struct zsync_state *zs; char *temp_file = NULL; @@ -460,7 +463,7 @@ int main(int argc, char **argv) { { /* Option parsing */ int opt; - while ((opt = getopt(argc, argv, "A:k:o:i:Vsqu:")) != -1) { + while ((opt = getopt(argc, argv, "A:k:o:O:i:Vsqu:")) != -1) { switch (opt) { case 'A': /* Authentication options for remote server */ { /* Scan string as hostname=username:password */ @@ -487,6 +490,10 @@ int main(int argc, char **argv) { free(filename); filename = strdup(optarg); break; + case 'O': + global_offset = atol(optarg); + if (global_offset%2) fprintf(stderr, "Warning: Odd offset defined\n"); + break; case 'i': seedfiles = append_ptrlist(&nseedfiles, seedfiles, optarg); break; @@ -519,8 +526,9 @@ int main(int argc, char **argv) { } /* No progress display except on terminal */ - if (!isatty(0)) - no_progress = 1; + // Ubuntu change: print progress even if output is not a tty. + //if (!isatty(0)) + // no_progress = 1; { /* Get proxy setting from the environment */ char *pr = getenv("http_proxy"); --- zsync-0.6.2.orig/http.c +++ zsync-0.6.2/http.c @@ -44,6 +44,8 @@ #include "progress.h" #include "format_string.h" +long global_offset = 0; + /* socket = connect_to(host, service/port) * Establishes a TCP connection to the named host and port (which can be * supplied as a service name from /etc/services. Returns the socket handle, or @@ -283,7 +285,7 @@ FILE *http_get(const char *orig_url, cha if (http_date_string(st.st_mtime, buf, sizeof(buf)) != NULL) snprintf(ifrange, sizeof(ifrange), "If-Unmodified-Since: %s\r\nRange: bytes=" OFF_T_PF - "-\r\n", buf, st.st_size); + "-\r\n", buf, st.st_size+global_offset); } else if (errno == ENOENT && stat(tfname, &st) == 0) { /* Else, if we have a complete possibly-old version, so only transfer @@ -770,7 +772,8 @@ static void range_fetch_getmore(struct r /* Append to the request */ snprintf(request + l, sizeof(request) - l, OFF_T_PF "-" OFF_T_PF "%s", - rf->ranges_todo[2 * i], rf->ranges_todo[2 * i + 1], + rf->ranges_todo[2 * i] + global_offset, + rf->ranges_todo[2 * i + 1] + global_offset, lastrange ? "" : ","); /* And record that we have sent this one */ @@ -901,8 +904,11 @@ int range_fetch_read_http_headers(struct * range and set our state appropriately */ off_t from, to; sscanf(p, "bytes " OFF_T_PF "-" OFF_T_PF "/", &from, &to); + from -= global_offset; + to -= global_offset; if (from <= to) { - rf->block_left = to + 1 - from; + if (global_offset && to%2) rf->block_left = to - from; + else rf->block_left = to + 1 - from; rf->offset = from; } @@ -1088,7 +1094,7 @@ int get_range_block(struct range_fetch * sscanf(buf, "content-range: bytes " OFF_T_PF "-" OFF_T_PF "/", &from, &to)) { - rf->offset = from; + rf->offset = from - global_offset; rf->block_left = to - from + 1; gotr = 1; }