summaryrefslogtreecommitdiff
path: root/methods
Commit message (Collapse)AuthorAgeFilesLines
* follow method attribute suggestions by gccDavid Kalnischkies2014-03-134-5/+5
| | | | | Git-Dch: Ignore Reported-By: gcc -Wsuggest-attribute={pure,const,noreturn}
* cleanup headers and especially #includes everywhereDavid Kalnischkies2014-03-1320-60/+80
| | | | | | | | Beside being a bit cleaner it hopefully also resolves oddball problems I have with high levels of parallel jobs. Git-Dch: Ignore Reported-By: iwyu (include-what-you-use)
* warning: unused parameter ‘foo’ [-Wunused-parameter]David Kalnischkies2014-03-136-17/+17
| | | | | Reported-By: gcc -Wunused-parameter Git-Dch: Ignore
* StartPos is always positive for http/httpsDavid Kalnischkies2014-03-132-8/+3
| | | | | | | | | server.cc: In member function ‘bool ServerState::HeaderLine(std::string)’: server.cc:198:72: warning: format ‘%llu’ expects argument of type ‘long long unsigned int*’, but argument 3 has type ‘long long int*’ [-Wformat=] else if (sscanf(Val.c_str(),"bytes %llu-%*u/%llu",&StartPos,&Size) != 2) Git-Dch: Ignore Reported-By: gcc -Wpedantic
* warning: extra ‘;’ [-Wpedantic]David Kalnischkies2014-03-137-31/+31
| | | | | Git-Dch: Ignore Reported-By: gcc -Wpedantic
* fix -Wformat= warnings about size_t != %lu on e.g. armelDavid Kalnischkies2014-03-131-6/+6
| | | | | Git-Dch: Ignore Reported-By: gcc
* fix -Wmissing-field-initializers warningsDavid Kalnischkies2014-03-131-2/+2
| | | | | Reported-By: gcc Git-Dch: Ignore
* Fix typos in documentation (codespell)Michael Vogt2014-02-2212-19/+19
|
* add a testcase to check for forbidden https→http downgradesDavid Kalnischkies2014-02-141-1/+2
| | | | Git-Dch: Ignore
* disable https->http redirects in libcurlMichael Vogt2014-02-141-0/+3
| | | | This change prevents changing the protocol from https to http.
* allow http protocol to switch to httpsDavid Kalnischkies2014-02-141-5/+9
| | | | | | | | | switch protocols at random is a bad idea if e.g. http can switch to file, so we limit the possibilities to http to http and http to https. As very few people (less than 1% according to popcon) have https installed this likely changes nothing in terms of failure. The commit is adding a friendly hint which package needs to be installed though.
* report https download start only if we really get itDavid Kalnischkies2014-02-141-1/+2
| | | | | | Reporting it via progress means that e.g. a redirect will trigger it, too, so you get a Get & Hit while http only reports a Hit as it should be.
* use utimes instead of utimensat/futimensDavid Kalnischkies2014-02-117-53/+46
| | | | | | | | | | | cppcheck complains about the obsolete utime as it was removed in POSIX1.2008 and recommends usage of utimensat/futimens instead as those are in POSIX and so commit 9ce3cfc9 switched to them. It is just that they aren't as portable as the standard suggests: At least our kFreeBSD and Hurd ports stumble over it at runtime. So to make both, the ports and cppcheck happy, we use utimes instead. Closes: 738567
* fix various style/performance warnings in rredDavid Kalnischkies2014-01-303-45/+24
| | | | | Reported-By: cppcheck Git-Dch: Ignore
* Merge remote-tracking branch 'donkult/debian/sid' into debian/sidMichael Vogt2014-01-2611-92/+94
|\ | | | | | | | | | | | | Conflicts: apt-private/private-list.cc doc/po/de.po test/integration/framework
| * correct some style/performance/warnings from cppcheckDavid Kalnischkies2014-01-1611-92/+94
| | | | | | | | | | | | | | | | The most "visible" change is from utime to utimensat/futimens as the first one isn't part of POSIX anymore. Reported-By: cppcheck Git-Dch: Ignore
* | methods/rred: minor robustness improvementsAnthony Towns2014-01-211-19/+20
| | | | | | | | | | Use retry_fwrite to better handle partial fwrite successes, and to keep the Hashes in sync with what's actually written.
* | integrate Anthonys rred with POC for client-side mergeDavid Kalnischkies2014-01-151-68/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | Providing the benefits of both without the downsides :) (ABI breaks or external dependencies) For this Anthonys rred is equipped with: - magic-filename-pickup of patches rather than explicit messages - use of FileFd instead of FILE* to get on-the-fly uncompress of the gzip compressed pdiff patches The acquire code in turn stops checking for apt-file's helper as our own rred is now clever enough for our needs.
* | reimplement rred to allow applying all the diffs in a single passAnthony Towns2014-01-151-600/+684
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Based on the idea presented in: https://lists.debian.org/deity/2009/08/msg00169.html and https://lists.debian.org/debian-devel/2014/01/msg00081.html It reads all patches one by one and merges them in-memory before applying the merged changes to the index. Beware: This commit by David Kalnischkies rips out the rred binary rewrite unchanged (expect minor format issue corrections) from the proposed changes, so this commit alone BREAKS pdiff completely. The integration into the acquire system as it was prepared in the previous POC will be done in the next commit to have proper 'blame'.
* | implement POC client-side merging of pdiffs via apt-fileDavid Kalnischkies2013-12-131-32/+96
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The idea of pdiffs is to avoid downloading the hole file by patching the existing index. This works very well, but becomes slow if a lot of patches needs to be applied to reconstruct an up-to-date index and in recent years more and more dinstall (or similar) runs are executed creating more and more pdiffs in the same amount of time, so pdiffs became less useful. The solution is simple: Reduce the amount of patches (which are very small) which need to be applied on top of the index we have available (which is usually pretty big). This can be done in two ways: Either merge the patches on the server-side so that the client has to download only one patch or the patches are all downloaded and merged on the client-side. The first needs a client who is doing one step at a time who can also skip patches if it needs (APT supports this for a long time now). The later is implemented by this commit, but depends on the server NOT merging the patches and the patches being in a strict order in which no patch is skipped. This is traditionally the case for dak, but other repository creators support merging – e.g. reprepro (which helpfully adds a flag indicating that the patches are merged). To support both or even mixes a client needs more information which isn't available for now. This POC uses the external diffindex-rred included in apt-file to do the heavy lifting of merging & applying all patches in one pass, hence to test this feature apt-file needs to be installed.
* add Acquire::http::Proxy-Auto-Detect to the apt.conf.5 manpage (closes: 726597)Michael Vogt2013-10-221-1/+5
|
* handle complete responses to https range requestsDavid Kalnischkies2013-10-016-25/+92
| | | | | | | | | | | | | Servers might respond with a complete file either because they don't support Ranges at all or the If-Range condition isn't statisfied, so we have to parse the headers curl gets ourself to seek or truncate the file we have so far. This also finially adds the testcase testing a bunch of partial situations for both, http and https - which is now all green. Closes: 617643, 667699 LP: 1157943
* fix partial (206 and 416) support in httpsDavid Kalnischkies2013-10-011-33/+67
| | | | | | | As lengthy discussed in lp:1157943 partial https support was utterly broken as a 206 response was handled as an (unhandled) error. This is the first part of fixing it by supporting a 206 response and starting to deal with 416.
* refactor http client implementationDavid Kalnischkies2013-10-015-889/+1049
| | | | | | | | | | | | | No effective behavior change, just shuffling big junks of code between methods and classes to split them into those strongly related to our client implementation and those implementing HTTP. The idea is to get HTTPS to a point in which most of the implementation can be shared even though the client implementations itself is completely different. This isn't anywhere near yet though, but it should beenough to reuse at least a few lines from http in https now. Git-Dch: Ignore
* replace "filesize - 1" trick in http with proper 416 handlingDavid Kalnischkies2013-10-011-6/+21
| | | | | | | | Our http client requests the "filesize - 1" for the small edgecase of handling a file which was completely downloaded, but not yet moved to the correct place as we get 416 errors in that case, but as we can handle 416 returns now we just special-case the situation of requesting the exact filesize and handle it as a 200 without content instead.
* retry without partial data after a 416 responseDavid Kalnischkies2013-10-011-2/+17
| | | | | | | | | | | | | | | If we get a 416 from the server it means the Range we asked for is above the real filesize of the file on the server. Mostly this happens if the server isn't supporting If-Range, but regardless of how we end up with the partial data, the data is invalid so we discard it and retry with a fresh plate and hope for the best. Old behavior was to consider 416 an error and retry with a different compression until we ran out of compression and requested the uncompressed file (which doesn't exist on most mirrors) with an accept line which server answered with "406 Not Acceptable". Closes: 710924
* Merge remote-tracking branch 'mvo/bugfix/coverity' into debian/sidMichael Vogt2013-07-284-1/+5
|\
| * fix missing va_end()Michael Vogt2013-07-262-0/+3
| |
| * add missing "free(buffer) for allocated bufferMichael Vogt2013-07-251-0/+1
| |
| * fix off-by-one error in HttpMethod::​AutoDetectProxy()Michael Vogt2013-07-251-1/+1
| |
* | request absolute URIs from proxies again (0.9.9.3 regession)David Kalnischkies2013-07-261-4/+16
| | | | | | | | | | | | | | | | Commit 2b9c9b7f28b18f6ae3e422020e8934872b06c9f3 not only removes keep-alive, but also changes the request URI send to proxies which are required to be absolute URIs rather than the usual absolute paths. Closes: 717891
* | Do not send a connection: keep-alive, at allRaphael Geissert2013-07-141-21/+8
|/
* trigger NODATA error for invalid InRelease filesDavid Kalnischkies2013-06-201-9/+7
| | | | | | | | | | | | | | | | | With the selfgrown splitting we got the problem of not recovering from networks which just reply with invalid data like those sending us login pages to authenticate with the network (e.g. hotels) back. The good thing about the InRelease file is that we know that it must be clearsigned (a Release file might or might not have a detached sig) so if we get a file but are unable to split it something is seriously wrong, so there is not much point in trying further. The Acquire system already looks out for a NODATA error from gpgv, so this adds a new error message sent to the acquire system in case the splitting we do now ourselves failed including this magic word. Closes: #712486
* remove -ldl from cdrom and -lutil from apt-get linkageDavid Kalnischkies2013-06-091-1/+1
| | | | | | | | | | Building src:apt shows: dpkg-shlibdeps: warning: package could avoid a useless dependency if debian/apt/usr/lib/apt/methods/cdrom was not linked against libdl.so.2 (it uses none of the library's symbols) dpkg-shlibdeps: warning: package could avoid a useless dependency if debian/apt/usr/bin/apt-get was not linked against libutil.so.1 (it uses none of the library's symbols)
* Fix double free (closes: #711045)Michael Vogt2013-06-061-0/+3
| | | | | | | * Fix double free (closes: #711045) * Fix crash when the "mirror" method does not find any entry (closes: #699303)
* merged patch from Daniel Hartwig to fix URI and proxy releated issuesMichael Vogt2013-05-082-8/+26
|
* merged from the debian-wheezy branchMichael Vogt2013-05-081-1/+6
|\
| * properly handle if-modfied-since with libcurl/https Michael Vogt2013-05-081-1/+6
| | | | | | | | (closes: #705648)
* | Fix English spelling error in a message ('A error'). Unfuzzybubulle@debian.org2013-04-101-1/+1
| | | | | | translations. Closes: #705087
* | merged bundle from davidMichael Vogt2013-04-081-2/+0
|\ \
| * | various simple changes to fix cppcheck warningsDavid Kalnischkies2013-03-101-2/+0
| | |
* | | merged lp:~mvo/apt/fix-inrelease5Michael Vogt2013-04-021-13/+2
|\ \ \
| * | | * apt-pkg/contrib/gpgv.cc:David Kalnischkies2013-03-151-13/+1
| | | | | | | | | | | | | | | | - ExecGPGV is a method which should never return, so mark it as such and fix the inconsistency of returning in error cases
| * | | * apt-pkg/indexcopy.cc:David Kalnischkies2013-03-151-1/+2
| | |/ | |/| | | | - rename RunGPGV to ExecGPGV and move it to apt-pkg/contrib/gpgv.cc
* | | * methods/connect.cc:Michael Vogt2013-03-251-2/+2
| | | | | | | | | - use Errno() instead of strerror(), thanks to David Kalnischk
* | | add new config options "Acquire::ForceIPv4" and Michael Vogt2013-03-221-0/+8
| | | | | | | | | | | | "Acquire::ForceIPv6" to allow focing one or the other (closes: #611891)
* | | merge patch from Colin to fix error message from getaddrinfo() (#703603)Michael Vogt2013-03-211-0/+3
| |/ |/|
* | quote plus in filenames to work around a bug in the S3 serverMichael Vogt2013-01-241-1/+5
| | | | | | (LP: #1003633)
* | * methods/http.cc:Michael Vogt2013-01-111-1/+1
| | | | | | | | | | | | - quote spaces in filenames to ensure as the http method is also (potentially) used for non deb,dsc content that may contain spaces, thanks to Daniel Hartwig and Thomas Bushnell (LP: #1086997)
* | add missing curl_easy_cleanup()Michael Vogt2013-01-091-0/+5
| |