From: Michael Vogt Date: Tue, 10 Jan 2006 16:46:30 +0000 (+0000) Subject: * fix http data corruption (#280844) X-Git-Tag: 0.7.24ubuntu1~275^2 X-Git-Url: https://git.saurik.com/apt.git/commitdiff_plain/c5691ddf15797bead5d77021ee0524635798bebb?ds=inline;hp=-c * fix http data corruption (#280844) Patches applied: * mvo@debian.org--2005/apt--debian-experimental--0--patch-12 * added http data corruption fix patch (#280844) --- c5691ddf15797bead5d77021ee0524635798bebb diff --combined configure.in index b975031e5,5ac3b0d8a..0d80e5ed9 --- a/configure.in +++ b/configure.in @@@ -18,7 -18,7 +18,7 @@@ AC_CONFIG_AUX_DIR(buildlib AC_CONFIG_HEADER(include/config.h:buildlib/config.h.in include/apti18n.h:buildlib/apti18n.h.in) dnl -- SET THIS TO THE RELEASE VERSION -- - AC_DEFINE_UNQUOTED(VERSION,"0.6.43.1") -AC_DEFINE_UNQUOTED(VERSION,"0.6.42.1exp1") ++AC_DEFINE_UNQUOTED(VERSION,"0.6.43.2") PACKAGE="apt" AC_DEFINE_UNQUOTED(PACKAGE,"$PACKAGE") AC_SUBST(PACKAGE) diff --combined debian/changelog index 5e14a92f9,67195fc7e..020fe9813 --- a/debian/changelog +++ b/debian/changelog @@@ -1,89 -1,16 +1,91 @@@ -apt (0.6.42.1exp1) experimental; urgency=low - - * added support for package index diffs - * added support for i18n of the package descriptions - * synced with the apt--debian-sid--0 branch - * build from mvo@debian.org--2005/apt--debian-experimental--0 - (from http://people.debian.org/~mvo/arch) - * fix bug in apt-cache when displaying the record (closes: #334887) +apt (0.6.43.2) unstable; urgency=low + + * Merge bubulle@debian.org--2005/apt--main--0 up to patch-159: + - en_GB.po, de.po: fix spaces errors in "Ign " translations + Closes: #347258 + - makefile: make update-po a pre-requisite of clean target so + that POT and PO files are always up-to-date + - sv.po: Completed to 511t. Closes: #346450 + - sk.po: Completed to 511t. Closes: #346369 + - fr.po: Completed to 511t + - *.po: Updated from sources (511 strings) + * add patch to fix http download corruption problem (thanks to + Petr Vandrovec, closes: #280844, #290694) - - -- Michael Vogt Wed, 19 Oct 2005 22:12:13 +0200 - -- ++ -- Michael Vogt Tue, 10 Jan 2006 17:09:31 +0100 + +apt (0.6.43.1) unstable; urgency=low + + * Merge bubulle@debian.org--2005/apt--main--0 up to patch-148: + * fr.po: Completed to 510 strings + * it.po: Completed to 510t + * en_GB.po: Completed to 510t + * cs.po: Completed to 510t + * zh_CN.po: Completed to 510t + * el.po: Updated to 510t + * vi.po: Updated to 383t93f34u + * tl.po: Completed to 510 strings (Closes: #344306) + * sv.po: Completed to 510 strings (Closes: #344056) + * LINGUAS: disabled Hebrew translation. (Closes: #313283) + * eu.po: Completed to 510 strings (Closes: #342091) + * apt-get source won't download already downloaded files again + (closes: #79277) + * share/debian-archive.gpg: new 2006 ftp-archive signing key added + (#345891) + * redownload the Release file if IMS-Hit and gpg failure + * deal with multiple signatures on a Release file + + -- Michael Vogt Fri, 6 Jan 2006 01:17:08 +0100 + +apt (0.6.43) unstable; urgency=medium + + * Merge bubulle@debian.org--2005/apt--main--0 up to patch-132: + * zh_CN.po: Completed to 510 strings(Closes: #338267) + * gl.po: Completed to 510 strings (Closes: #338356) + * added support for "/etc/apt/sources.list.d" directory + (closes: #66325) + * make pkgDirStream (a bit) more complete + * fix bug in pkgCache::VerIterator::end() (thanks to Daniel Burrows) + (closes: #339533) + * pkgAcqFile is more flexible now (closes: #57091) + * support a download rate limit for http (closes: #146877) + * included lots of the speedup changes from #319377 + * add stdint.h to contrib/md5.h (closes: #340448) + * ABI change, library name changed (closes: #339147) + * Fix GNU/kFreeBSD crash on non-existing server file (closes: #317718) + * switch to libdb4.3 in build-depends + + -- Michael Vogt Tue, 29 Nov 2005 00:17:07 +0100 + +apt (0.6.42.3) unstable; urgency=low + + * Merge bubulle@debian.org--2005/apt--main--0 up to patch-129: + - patch-118: Russian translation update by Yuri Kozlov (closes: #335164) + - patch-119: add update-po as a pre-req for binary (closes: #329910) + - patch-121: Complete French translation + - patch-125: Fixed localization of y/n questions in German translation + (closes: #337078) + - patch-126: Swedish translation update (closes: #337163) + - patch-127: Complete Tagalog translation (closes: #337306) + - patch-128: Danish translation update (closes: #337949) + - patch-129: Basque translation update (closes: #338101) + * cmdline/apt-get.cc: + - bufix in FindSrc (closes: #335213, #337910) + * added armeb to archtable (closes: #333599) + * with --allow-unauthenticated use the old fallback behaviour for + sources (closes: #335112) + + -- Michael Vogt Wed, 9 Nov 2005 07:22:31 +0100 + +apt (0.6.42.2) unstable; urgency=high + + * NMU (approved by maintainer) + * Add AMD64 archive signing key to debian-archive.gpg (closes: #336500). + * Add big-endian arm (armeb) support (closes: #333599). + * Priority high to get the AMD key into testing ASAP. + + -- Frans Pop Sun, 30 Oct 2005 21:29:11 +0100 + apt (0.6.42.1) unstable; urgency=low * fix a incorrect example in the apt_prefrences man page @@@ -127,7 -54,7 +129,7 @@@ apt (0.6.42) unstable; urgency=lo * cmdline/apt-cdrom.cc: - fix some missing gettext() calls (closes: #334539) * doc/apt-cache.8.xml: fix typo (closes: #334714) - + -- Michael Vogt Wed, 19 Oct 2005 22:02:09 +0200 apt (0.6.41) unstable; urgency=low @@@ -212,6 -139,7 +214,6 @@@ apt (0.6.38) unstable; urgency=lo -- Matt Zimmerman Sat, 25 Jun 2005 09:51:00 -0700 ->>>>>>> MERGE-SOURCE apt (0.6.37) breezy; urgency=low * Merge bubulle@debian.org--2005/apt--main--0 up to patch-81 diff --combined methods/http.cc index dc3f0b763,dbf2d1b43..341de94e3 --- a/methods/http.cc +++ b/methods/http.cc @@@ -59,11 -59,6 +59,11 @@@ unsigned long TimeOut = 120 bool Debug = false; +unsigned long CircleBuf::BwReadLimit=0; +unsigned long CircleBuf::BwTickReadData=0; +struct timeval CircleBuf::BwReadTick={0,0}; +const unsigned int CircleBuf::BW_HZ=10; + // CircleBuf::CircleBuf - Circular input buffer /*{{{*/ // --------------------------------------------------------------------- /* */ @@@ -71,8 -66,6 +71,8 @@@ CircleBuf::CircleBuf(unsigned long Size { Buf = new unsigned char[Size]; Reset(); + + CircleBuf::BwReadLimit = _config->FindI("Acquire::http::Dl-Limit",0)*1024; } /*}}}*/ // CircleBuf::Reset - Reset to the default state /*{{{*/ @@@ -98,45 -91,16 +98,45 @@@ void CircleBuf::Reset( is non-blocking.. */ bool CircleBuf::Read(int Fd) { + unsigned long BwReadMax; + while (1) { // Woops, buffer is full if (InP - OutP == Size) return true; + // what's left to read in this tick + BwReadMax = CircleBuf::BwReadLimit/BW_HZ; + + if(CircleBuf::BwReadLimit) { + struct timeval now; + gettimeofday(&now,0); + + unsigned long d = (now.tv_sec-CircleBuf::BwReadTick.tv_sec)*1000000 + + now.tv_usec-CircleBuf::BwReadTick.tv_usec; + if(d > 1000000/BW_HZ) { + CircleBuf::BwReadTick = now; + CircleBuf::BwTickReadData = 0; + } + + if(CircleBuf::BwTickReadData >= BwReadMax) { + usleep(1000000/BW_HZ); + return true; + } + } + // Write the buffer segment int Res; - Res = read(Fd,Buf + (InP%Size),LeftRead()); + if(CircleBuf::BwReadLimit) { + Res = read(Fd,Buf + (InP%Size), + BwReadMax > LeftRead() ? LeftRead() : BwReadMax); + } else + Res = read(Fd,Buf + (InP%Size),LeftRead()); + if(Res > 0 && BwReadLimit > 0) + CircleBuf::BwTickReadData += Res; + if (Res == 0) return false; if (Res < 0) @@@ -241,28 -205,23 +241,23 @@@ bool CircleBuf::WriteTillEl(string &Dat if (Buf[I%Size] != '\n') continue; ++I; - if (I < InP && Buf[I%Size] == '\r') - ++I; if (Single == false) { - if (Buf[I%Size] != '\n') - continue; - ++I; if (I < InP && Buf[I%Size] == '\r') ++I; + if (I >= InP || Buf[I%Size] != '\n') + continue; + ++I; } - if (I > InP) - I = InP; - Data = ""; while (OutP < I) { unsigned long Sz = LeftWrite(); if (Sz == 0) return false; - if (I - OutP < LeftWrite()) + if (I - OutP < Sz) Sz = I - OutP; Data += string((char *)(Buf + (OutP%Size)),Sz); OutP += Sz; @@@ -824,10 -783,7 +819,10 @@@ bool HttpMethod::Flush(ServerState *Srv { if (File != 0) { - SetNonBlock(File->Fd(),false); + // on GNU/kFreeBSD, apt dies on /dev/null because non-blocking + // can't be set + if (File->Name() != "/dev/null") + SetNonBlock(File->Fd(),false); if (Srv->In.WriteSpace() == false) return true; @@@ -855,10 -811,7 +850,10 @@@ bool HttpMethod::ServerDie(ServerState // Dump the buffer to the file if (Srv->State == ServerState::Data) { - SetNonBlock(File->Fd(),false); + // on GNU/kFreeBSD, apt dies on /dev/null because non-blocking + // can't be set + if (File->Name() != "/dev/null") + SetNonBlock(File->Fd(),false); while (Srv->In.WriteSpace() == true) { if (Srv->In.Write(File->Fd()) == false)