summaryrefslogtreecommitdiff
path: root/methods/server.cc
Commit message (Collapse)AuthorAgeFilesLines
* Rename "Size" in ServerState to TotalFileSizeMichael Vogt2015-05-221-10/+10
| | | | | | | | The variable "Size" was misleading and caused bug #1445239. To avoid similar issues in the future, rename it to make the meaning more obvious. git-dch: ignore
* Fix endless loop in apt-get update that can cause disk fillupMichael Vogt2015-05-221-5/+15
| | | | | | | | | | | | | | | | The apt http code parses Content-Length and Content-Range. For both requests the variable "Size" is used and the semantic for this Size is the total file size. However Content-Length is not the entire file size for partital file requests. For servers that send the Content-Range header first and then the Content-Length header this can lead to globbing of Size so that its less than the real file size. This may lead to a subsequent passing of a negative number into the CircleBuf which leads to a endless loop that writes data. Thanks to Anton Blanchard for the analysis and initial patch. LP: #1445239
* Fix crash in the apt-transport-https when Owner is NULLTomasz Buchert2015-02-231-1/+1
| | | | | | Do not crash in ServerState::HeaderLine if there is no Owner. Closes: #778375
* dispose http(s) 416 error page as non-contentDavid Kalnischkies2014-12-221-11/+15
| | | | | | | | | | | | | | | | | | | | | | | Real webservers (like apache) actually send an error page with a 416 response, but our client didn't expect it leaving the page on the socket to be parsed as response for the next request (http) or as file content (https), which isn't what we want at all… Symptom is a "Bad header line" as html usually doesn't parse that well to an http-header. This manifests itself e.g. if we have a complete file (or larger) in partial/ which isn't discarded by If-Range as the server doesn't support it (or it is just newer, think: mirror rotation). It is a sort-of regression of 78c72d0ce22e00b194251445aae306df357d5c1a, which removed the filesize - 1 trick, but this had its own problems… To properly test this our webserver gains the ability to reply with transfer-encoding: chunked as most real webservers will use it to send the dynamically generated error pages. (The tests and their binary helpers had to be slightly modified to apply, but the patch to fix the issue itself is unchanged.) Closes: 768797
* Improve Debug::Acquire::http debug outputMichael Vogt2014-09-051-3/+4
| | | | | Prefix all answers with the URL that the answer is for. This helps when debugging and pipeline is enabled.
* cleanup headers and especially #includes everywhereDavid Kalnischkies2014-03-131-16/+11
| | | | | | | | 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: extra ‘;’ [-Wpedantic]David Kalnischkies2014-03-131-10/+10
| | | | | Git-Dch: Ignore Reported-By: gcc -Wpedantic
* Fix typos in documentation (codespell)Michael Vogt2014-02-221-3/+3
|
* 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.
* use utimes instead of utimensat/futimensDavid Kalnischkies2014-02-111-6/+6
| | | | | | | | | | | 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
* correct some style/performance/warnings from cppcheckDavid Kalnischkies2014-01-161-13/+12
| | | | | | | | 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
* refactor http client implementationDavid Kalnischkies2013-10-011-0/+665
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