- Apr 01, 2017
-
-
Gregory Szorc authored
Previously, --headeronly would prevent --twice from working because the ETag wasn't stored when --headeronly was used. This feels like a bug. That feeling is reaffirmed by the fact that this change doesn't regress any tests.
-
- Dec 24, 2016
-
-
Gregory Szorc authored
With this commit, the HTTP transport now parses the X-HgProto-<N> header to determine what media type and compression engine to use for responses. So far, we only compress responses that are already being compressed with zlib today (stream response types to specific commands). We can expand things to cover additional response types later. The practical side-effect of this commit is that non-zlib compression engines will be used if both ends support them. This means if both ends have zstd support, zstd - not zlib - will be used to compress data! When cloning the mozilla-unified repository between a local HTTP server and client, the benefits of non-zlib compression are quite noticeable: engine server CPU (s) client CPU (s) bundle size zlib (l=6) 174.1 283.2 1,148,547,026 zstd (l=1) 99.2 267.3 1,127,513,841 zstd (l=3) 103.1 266.9 1,018,861,363 zstd (l=7) 128.3 269.7 919,190,278 zstd (l=10) 162.0 - 894,547,179 none 95.3 277.2 4,097,566,064 The default zstd compression level is 3. So if you deploy zstd capable Mercurial to your clients and servers and CPU time on your server is dominated by "getbundle" requests (clients cloning and pulling) - and my experience at Mozilla tells me this is often the case - this commit could drastically reduce your server-side CPU usage *and* save on bandwidth costs! Another benefit of this change is that server operators can install *any* compression engine. While it isn't enabled by default, the "none" compression engine can now be used to disable wire protocol compression completely. Previously, commands like "getbundle" always zlib compressed output, adding considerable overhead to generating responses. If you are on a high speed network and your server is under high load, it might be advantageous to trade bandwidth for CPU. Although, zstd at level 1 doesn't use that much CPU, so I'm not convinced that disabling compression wholesale is worthwhile. And, my data seems to indicate a slow down on the client without compression. I suspect this is due to a lack of buffering resulting in an increase in socket read() calls and/or the fact we're transferring an extra 3 GB of data (parsing HTTP chunked transfer and processing extra TCP packets can add up). This is definitely worth investigating and optimizing. But since the "none" compressor isn't enabled by default, I'm inclined to punt on this issue. This commit introduces tons of tests. Some of these should arguably have been implemented on previous commits. But it was difficult to test without the server functionality in place.
-
- Jun 28, 2016
-
-
Pulkit Goyal authored
The httplib library is renamed to http.client in python 3. So the import is conditionalized and a test is added in check-code to warn to use util.httplib
-
- Apr 02, 2016
-
-
Robert Stanca authored
-
- Dec 07, 2015
-
-
Gregory Szorc authored
While I was here, I removed condition code for failure to import json. This code was necessary to support Python < 2.6, which didn't include the json module.
-
- May 18, 2015
-
-
Pierre-Yves David authored
There is no reason to not have simple code now that Python 2.4 is dead.
-
- Mar 31, 2015
-
-
Gregory Szorc authored
Upcoming patches will add support for JSON output from hgweb. Because JSON output from the templater is hard to read and because it is easy to introduce malformed JSON, we introduce a JSON processing mode to get-with-headers.py that will parse and pretty print JSON from HTTP responses. This will make tests easier to read and write and it will ensure hgweb is emitting well-formed JSON.
-
- Nov 28, 2014
-
-
Gregory Szorc authored
This patch fixes a bug where hgweb would send an incomplete HTTP response. If an uncaught exception is raised when hgweb is processing a request, hgweb attempts to send a generic error response and log that exception. The server defaults to chunked transfer coding. If an uncaught exception occurred, it was sending the error response string / chunk properly. However, RFC 7230 Section 4.1 mandates a 0 size last chunk be sent to indicate end of the entity body. hgweb was failing to send this last chunk. As a result, properly written HTTP clients would assume more data was coming and they would likely time out waiting for another chunk to arrive. Mercurial's own test harness was paving over the improper HTTP behavior by not attempting to read the response body if the status code was 500. This incorrect workaround was added in ba6577a19656 and has been removed with this patch.
-
- Oct 02, 2013
-
-
Javi Merino authored
If the server had an internal error and returned 500, there's nothing to read, so "response.read()" blocks indefinitely. Only output the response if there's really a response.
-
- Jan 16, 2013
-
-
Pierre-Yves David authored
In some case we do not care about the actual rendering.
-
Mads Kiilerich authored
Instability introduced in combination of a4d7fd7ad1f7 and e389a25e7e60.
-
- Jan 15, 2013
-
-
Mads Kiilerich authored
Fixes HTTP protocol violation introduced in cf5c76017e11. 'hg serve' would show a stacktrace when loading pages that not had been modified. There was test coverage for this, but the wrong response headers wasn't shown and thus not detected.
-
- Jun 21, 2012
-
-
kiilerix authored
get-with-headers.py took the http GET parameter as a command line parameter that had to start with '/'. MSYS on windows will mangle such paths. Instead of applying a workaround everywhere (such as an extra '/') we let get-with-headers.py add the mandatory '/'. That is consistent with the url path handling in the Mercurial url class. A few tests sent 'GET ?cmd=...' which is invalid. They will now send 'GET /?cmd=...'. This will not enable any tests for being run on windows - only remove one reason they were disabled.
-
- Sep 11, 2010
-
-
Dirkjan Ochtman authored
Thanks to lcantey for catching it.
-
- Sep 08, 2010
-
-
Dirkjan Ochtman authored
-
- Apr 14, 2010
-
-
Nicolas Dumazet authored
-
- Nov 05, 2009
-
-
Dirkjan Ochtman authored
-
- May 16, 2009
-
-
Martin Geisler authored
-
- Dec 25, 2008
-
-
Gilles Moris authored
Note that other sed replacement commands are also filtering get-with-headers.py, but they seem to be more test specific, hence not handled here.
-
- Sep 28, 2008
-
-
Patrick Mezard authored
-
- Nov 28, 2007
-
-
Bryan O'Sullivan authored
-
- Jun 29, 2006
-
-
Eric Hopper authored
-