--- Begin Message ---
- To: Debian Bug Tracking System <submit@bugs.debian.org>
- Subject: doesn't reset curl options between files or timestamp downloaded files
- From: Ryan Murray <rmurray@debian.org>
- Date: Fri, 10 Aug 2007 11:06:03 -0700
- Message-id: <20070810180603.32350.32523.reportbug@ninsei.internal.cyberhqz.com>
Package: apt-transport-https
Version: 0.7.6
Severity: normal
The following patch address two problems in the apt https method:
1. the curl options aren't reset between files, causing the previous files
settings to be used for the next, which can be a problem if the setting was
a lastmodified or range request.
2. Downloaded files aren't set to the time of the remote server (if available).
This breaks 304 support compared to the http method, as the files always have
the last downloaded time, rather than the last time from the web server.
This patch is against bzr revno 1517 of methods/https.cc
--- /home/rmurray/aptbzr/methods/https.cc 2007-08-09 20:32:36.707623733 -0700
+++ /home/rmurray/https.cc 2007-08-10 10:51:54.015466148 -0700
@@ -115,6 +115,7 @@
// - error checking/reporting
// - more debug options? (CURLOPT_DEBUGFUNCTION?)
+ curl_easy_reset(curl);
SetupProxy();
// callbacks
@@ -125,6 +126,7 @@
curl_easy_setopt(curl, CURLOPT_PROGRESSDATA, this);
curl_easy_setopt(curl, CURLOPT_NOPROGRESS, false);
curl_easy_setopt(curl, CURLOPT_FAILONERROR, true);
+ curl_easy_setopt(curl, CURLOPT_FILETIME, true);
// FIXME: https: offer various options of verification
bool peer_verify = _config->FindB("Acquire::https::Verify-Peer", false);
@@ -202,6 +204,9 @@
CURLcode success = curl_easy_perform(curl);
curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &curl_responsecode);
+ long curl_servdate;
+ curl_easy_getinfo(curl, CURLINFO_FILETIME, &curl_servdate);
+
// cleanup
if(success != 0)
{
@@ -215,6 +220,14 @@
if (Res.Size == 0)
Res.Size = File->Size();
+ // Timestamp
+ struct utimbuf UBuf;
+ if (curl_servdate != -1) {
+ UBuf.actime = curl_servdate;
+ UBuf.modtime = curl_servdate;
+ utime(File->Name().c_str(),&UBuf);
+ }
+
// check the downloaded result
struct stat Buf;
if (stat(File->Name().c_str(),&Buf) == 0)
-- System Information:
Debian Release: lenny/sid
APT prefers unstable
APT policy: (500, 'unstable')
Architecture: i386 (x86_64)
Kernel: Linux 2.6.20.15 (SMP w/4 CPU cores; PREEMPT)
Locale: LANG=en_CA, LC_CTYPE=en_CA (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash
Versions of packages apt-transport-https depends on:
ii apt [libapt-pkg-libc6.6-6-4.4 0.7.6 Advanced front-end for dpkg
ii libc6 2.6.1-1 GNU C Library: Shared libraries
ii libcurl3-gnutls 7.16.4-2 Multi-protocol file transfer libra
ii libgcc1 1:4.2.1-2 GCC support library
ii libstdc++6 4.2.1-2 The GNU Standard C++ Library v3
apt-transport-https recommends no packages.
-- no debconf information
--- End Message ---
--- Begin Message ---
Source: apt
Source-Version: 0.7.7
We believe that the bug you reported is fixed in the latest version of
apt, which is due to be installed in the Debian FTP archive:
apt-doc_0.7.7_all.deb
to pool/main/a/apt/apt-doc_0.7.7_all.deb
apt-transport-https_0.7.7_i386.deb
to pool/main/a/apt/apt-transport-https_0.7.7_i386.deb
apt-utils_0.7.7_i386.deb
to pool/main/a/apt/apt-utils_0.7.7_i386.deb
apt_0.7.7.dsc
to pool/main/a/apt/apt_0.7.7.dsc
apt_0.7.7.tar.gz
to pool/main/a/apt/apt_0.7.7.tar.gz
apt_0.7.7_i386.deb
to pool/main/a/apt/apt_0.7.7_i386.deb
libapt-pkg-dev_0.7.7_i386.deb
to pool/main/a/apt/libapt-pkg-dev_0.7.7_i386.deb
libapt-pkg-doc_0.7.7_all.deb
to pool/main/a/apt/libapt-pkg-doc_0.7.7_all.deb
A summary of the changes between this version and the previous one is
attached.
Thank you for reporting the bug, which will now be closed. If you
have further comments please address them to 437150@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.
Debian distribution maintenance software
pp.
Michael Vogt <mvo@debian.org> (supplier of updated apt package)
(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@debian.org)
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Format: 1.7
Date: Tue, 23 Oct 2007 14:58:03 +0200
Source: apt
Binary: apt-utils libapt-pkg-doc libapt-pkg-dev apt-transport-https apt-doc apt
Architecture: source all i386
Version: 0.7.7
Distribution: unstable
Urgency: low
Maintainer: APT Development Team <deity@lists.debian.org>
Changed-By: Michael Vogt <mvo@debian.org>
Description:
apt - Advanced front-end for dpkg
apt-doc - Documentation for APT
apt-transport-https - APT https transport
apt-utils - APT utility programs
libapt-pkg-dev - Development files for APT's libapt-pkg and libapt-inst
libapt-pkg-doc - Documentation for APT development
Closes: 133421 133421 423272 436055 436425 437150 440611 441102 441942 442833 445468 446626
Changes:
apt (0.7.7) unstable; urgency=low
.
[ Michael Vogt ]
* apt-inst/contrib/extracttar.cc:
- fix fd leak for zero size files (thanks to Bill Broadley for
reporting this bug)
* apt-pkg/acquire-item.cc:
- remove zero size files on I-M-S hit
* methods/https.cc:
- only send LastModified if we actually have a file
- send range request with if-range
- delete failed downloads
- delete zero size I-M-S hits
* apt-pkg/deb/dpkgpm.{cc,h}:
- merged dpkg-log branch, this lets you specify a
Dir::Log::Terminal file to log dpkg output to
(ABI break)
- fix parse error when dpkg sends unexpected data
* merged apt--sha256 branch to fully support the new
sha256 checksums in the Packages and Release files
(ABI break)
* apt-pkg/pkgcachegen.cc:
- increase default mmap size
* tests/local-repo:
- added local repository testcase
* apt-pkg/acquire.cc:
- increase MaxPipeDepth for the internal worker<->method
communication to 1000 for the debtorrent backend
* make apt build with g++ 4.3
* fix missing SetExecClose() call when the status-fd is used
* debian/apt.cron.daily:
- move unattended-upgrade before apt-get autoclean
* fix "purge" commandline argument, closes: #133421
(thanks to Julien Danjou for the patch)
* cmdline/apt-get.cc:
- do not change the auto-installed information if a package
is reinstalled
* apt-pkg/acquire-item.cc:
- fix crash in diff acquire code
* cmdline/apt-mark:
- Fix chmoding after have renamed the extended-states file (LP: #140019)
(thanks to Laurent Bigonville)
* apt-pkg/depcache.cc:
- set "APT::Install-Recommends" to true by default (OMG!)
* debian/apt.cron.daily:
- only run the cron job if apt-get check succeeds (LP: #131719)
.
[ Program translations ]
- French updated
- Basque updated. Closes: #436425
- Fix the zh_CN translator's name in debian/changelog for 0.7.2
Closes: #423272
- Vietnamese updated. Closes: #440611
- Danish updated. Closes: #441102
- Thai added. Closes: #442833
- Swedish updated.
- Galician updated. Closes: #446626
.
[ Otavio Salvador ]
* Add hash support to copy method. Thanks Anders Kaseorg by the patch
(closes: #436055)
* Reset curl options and timestamp between downloaded files. Thanks to
Ryan Murray <rmurray@debian.org> for the patch (closes: #437150)
* Add support to apt-key to export keys to stdout. Thanks to "Dwayne
C. Litzenberger" <dlitz@dlitz.net> for the patch (closes: #441942)
* Fix compilation warnings:
- apt-pkg/indexfile.cc: conversion from string constant to 'char*';
- apt-pkg/acquire-item.cc: likewise;
- apt-pkg/cdrom.cc: '%lu' expects 'long unsigned int', but argument
has type 'size_t';
- apt-pkg/deb/dpkgpm.cc: initialization order and conversion from
string constant to 'char*';
- methods/gpgv.cc: conversion from string constant to 'char*';
- methods/ftp.cc: likewise;
- cmdline/apt-extracttemplates.cc: likewise;
- apt-pkg/deb/debmetaindex.cc: comparison with string literal results
in unspecified behaviour;
* cmdline/apt-get.cc: adds 'autoremove' as a valid comment to usage
statement of apt-get (closes: #445468).
* cmdline/apt-get.cc: really applies Julien Danjou <acid@debian.org>
patch to add 'purge' command line argument (closes: #133421).
.
[ Ian Jackson ]
* dpkg-triggers: Deal properly with new package states.
.
[ Colin Watson ]
* apt-pkg/contrib/mmap.cc:
- don't fail if msync() returns > 0
Files:
f5ba936675b18bd537131d5bb09ca24b 942 admin important apt_0.7.7.dsc
ab7657852d824d66d96bcb08a282090d 1920200 admin important apt_0.7.7.tar.gz
033c2bab986a895e7a12a3c154bf16a4 92700 doc optional apt-doc_0.7.7_all.deb
62457c506a857e022962f1215f80fd9d 117092 doc optional libapt-pkg-doc_0.7.7_all.deb
41c78052538cb5fa29b8caa4b0985542 51774 admin optional apt-transport-https_0.7.7_i386.deb
f05a7aabcfce82870b39ce37b29a4f0c 1445864 admin important apt_0.7.7_i386.deb
4869275480edefbc5ade98ab94dd79a1 101484 libdevel optional libapt-pkg-dev_0.7.7_i386.deb
76dd891899bf906ae9ed3a488412faa1 188588 admin important apt-utils_0.7.7_i386.deb
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
iD8DBQFHHhVrliSD4VZixzQRAifhAJ9UvCgeLaAJUPlKfGwuvb5z8aBdYQCfR2pO
/UyggrT0kJ1w2odlCibDmbc=
=W9Vr
-----END PGP SIGNATURE-----
--- End Message ---