Commit Graph

61 Commits

Author SHA1 Message Date
Michael Vogt ffd2dd93a6 make https honor ExpectedSize as well 2014-08-26 19:20:04 -07:00
David Kalnischkies 062074cb51 enforce LFS for partial files in https range requests 2014-04-26 09:51:05 +02:00
David Kalnischkies 453b82a388 cleanup headers and especially #includes everywhere
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)
2014-03-13 13:58:45 +01:00
David Kalnischkies 655122418d warning: unused parameter ‘foo’ [-Wunused-parameter]
Reported-By: gcc -Wunused-parameter
Git-Dch: Ignore
2014-03-13 13:58:45 +01:00
David Kalnischkies d3e8fbb395 warning: extra ‘;’ [-Wpedantic]
Git-Dch: Ignore
Reported-By: gcc -Wpedantic
2014-03-13 13:58:45 +01:00
Michael Vogt 1e3f4083db Fix typos in documentation (codespell) 2014-02-22 18:34:33 +01:00
David Kalnischkies 889b0072a9 add a testcase to check for forbidden https→http downgrades
Git-Dch: Ignore
2014-02-14 19:15:43 +01:00
Michael Vogt dc95fee18e disable https->http redirects in libcurl
This change prevents changing the protocol from https to http.
2014-02-14 19:10:47 +01:00
David Kalnischkies f9b4f12d65 report https download start only if we really get it
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.
2014-02-14 00:45:10 +01:00
David Kalnischkies 246bbb611d use utimes instead of utimensat/futimens
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
2014-02-11 02:28:27 +01:00
David Kalnischkies 9ce3cfc930 correct some style/performance/warnings from cppcheck
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
2014-01-16 22:19:49 +01:00
David Kalnischkies fd46d30571 handle complete responses to https range requests
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
2013-10-01 11:17:02 +02:00
David Kalnischkies 85050e7644 fix partial (206 and 416) support in https
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.
2013-10-01 11:08:12 +02:00
Michael Vogt 5b63d2a9a2 merged patch from Daniel Hartwig to fix URI and proxy releated issues 2013-05-08 17:50:15 +02:00
Michael Vogt 597341fe0f merged from the debian-wheezy branch 2013-05-08 17:48:31 +02:00
Michael Vogt 1dea08eb2e properly handle if-modfied-since with libcurl/https
(closes: #705648)
2013-05-08 17:45:17 +02:00
Michael Vogt cc41811512 * methods/https.cc:
- reuse connection in https, thanks to Thomas Bushnell, BSG for the
    patch. LP: #1087543, Closes: #695359
2013-01-09 11:00:13 +01:00
David Kalnischkies 335e2c82af add spaces around PACKAGE_VERSION to fix FTBFS with -std=c++11 2012-05-17 14:21:13 +02:00
David Kalnischkies 9179f697ed the previously used VERSION didn't work everywhere so we are switching
to the more standard PACKAGE_VERSION and make it work in every file
2012-03-22 00:16:11 +01:00
David Kalnischkies 6f4501f96f * methods/http{s,}.cc:
- if a file without an extension is requested send an 'Accept: text/*'
    header to avoid that the server chooses unsupported compressed files
    in a content-negotation attempt (Closes: #657560)
2012-01-30 16:26:10 +01:00
David Kalnischkies 8654fae974 * methods/https.cc:
- use curls list append instead of appending Range and If-Range by hand
    which generates malformed requests, thanks Mel Collins for the hint!
    (Closes: #646381)
2012-01-19 23:51:00 +01:00
David Kalnischkies 109eb1511d try to avoid direct usage of .Fd() if possible and do read()s and co
on the FileFd instead
2011-12-17 23:53:31 +01:00
David Kalnischkies 0fffbc8ce4 merge with current debian apt/experimental 2011-10-05 18:43:00 +02:00
Michael Vogt 7be8c02360 * apt-pkg/contrib/configuration.cc:
- fix double delete (LP: #848907)
  - ignore only the invalid regexp instead of all options
* apt-pkg/acquire-item.h, apt-pkg/deb/debmetaindex.cc:
  - fix fetching language information by adding OptionalSubIndexTarget
* methods/https.cc:
  - cleanup broken downloads properly

* ftparchive/cachedb.cc:
  - fix buffersize in bytes2hex
* apt-pkg/deb/deblistparser.cc:
  - fix crash when the dynamic mmap needs to be grown in
    LoadReleaseInfo (LP: #854090)
2011-10-05 18:14:38 +02:00
Michael Vogt db1f14695c * methods/https.cc:
- cleanup broken downloads properly
2011-09-20 18:21:21 +02:00