Possibly the combination of "gzip" and us being unhelpful about
lengths could lead to browser hangs; who can say.
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
Change-Id: I632dfc46afde3883544292d687bdff023bccc8ac
The explicit header entries were needed
with Poco, but since we always set them
in our http::Response constructor, these
are redundant.
Change-Id: Ifde48fd3048018747dae3e84560b31960e511a25
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
config.h should be included as the 1st line in each source file.
It should not be included in headers.
config_version.h which changes on every commit should not be
included widely - so remove it from the HttpRequest heeader to
save tinderbox's ccache.
Fetch version info from helper methods rather than in-lining via
defines, to better encapsulate.
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
Change-Id: If449a36f1ac61940f04d70d5f4180db389d9b4c4
We now use our http::Response in HttpHelper::sendFileAndShutdown.
Change-Id: I77503fce7a66a11435bad896d3d5d6df611544be
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
Since we don't want to propagate Poco types
as well as our pair containers, it's best
to have these are named functions rather
than as operator<<.
Change-Id: I9772b8f314262147b6c445464bf3ce8cb598b56d
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
The range header allows a client to specify that they would like only
part of a file, e.g. only the first 1000 bytes of a video. When playing
video on Apple devices (Macs, iPads, iPhones etc.) this is required to
avoid Safari rejecting the video as broken. This is the first part of a
fix to embedded videos on Safari.
This commit does not implement specifying multiple ranges at once (e.g.
bytes=0-9,-100 to get the first 10 and last 100 bytes).
This feature is necessary to play video on Apple devices, but it is not
sufficient. In particular, I believe some further client-side fixes will
be needed to make the video play properly.
Signed-off-by: Skyler Grey <skyler.grey@collabora.com>
Change-Id: Id89a06d374b7d0efbf2b3184d8618df61684dcb6
newRequest is always called with a const Request& already so might as
well make this copy inside the function rather than passing a copy
by value and moving it.
Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: Ib572637d29590b8b470a42da3293065ed86d7dd0
iss ctor takes a const std::string& and constructs with a copy of str as content
Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: I2805c869cb034a9b87e6e95cc58419b54a078b63
configure currently requires a min of c++17
Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: I613dac6e66c3e77183d46623346969179bccc489
Using our own http library, we request
cool.html with realistic parameters and
validate many key values sent in the
request.
Change-Id: Ie3c0ac042f64bf5d6ed21354a33efac801b32846
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
Fortunately, we have no need for any locals
in this case.
Change-Id: I954953bb2a8c79662152ad4cc2fb5422bc2b0baa
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
Previously, we didn't expect such exceptions,
but increasingly this can happen, as we have
more and more async processing. The main
issue with not catching exceptions is that
we do not properly discard read and
parsed data from the socket. This is a
major issue, of course.
Change-Id: I4490baed7069cd55d103301c1d3be31d9b2d9b2c
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
github_android_online_co-23.05/net/HttpRequest.hpp:1391:63: error: no matching function for call to 'min'
<< Util::dumpHex(std::string(data.data(), std::min(data.size(), 256UL))));
^~~~~~~~
Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: I5b81096c696565b9e4eb4f3ca39c16bc1e5b9182
The normal path is now streamlined and error handling
is at the end. We also now always set the disposition
to closed and fire onDisconnect() when disconnected
or hit an error.
Change-Id: I984ad71601b92b8042dc7984e7339f0804c8083b
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
We use our own status codes, which
are type-safe and use streaming
operators to serialize and log.
Change-Id: I0eba7b16694866b5a79476a7ef4b1b78f7f9c176
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
This is needed to correct overload
resolution of these operators.
Change-Id: I02c0859674efe112102a8d3833bfb0a30b1a6574
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
This replaces the hard-coded status-code
numbers with named compile-time constants.
Change-Id: Ibe678fb2c533b29efd696e4430f5377523eeb298
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
Apparently it woke up the world unnecessarily.
Change-Id: Iad65215da898b017860e7d7b803771f657a3e1ab
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
This avoids wakeup warning us that the thread is not started to wakeup.
Change-Id: Ifd5c483717024cb1c30521433d0d10acead01e2f
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
Eg. if only the version was changed, config.h was updated, and
everything was recompiled.
New structure, maintain these manually:
config.h.in - for configured variables that are stable if
configuration parameters are unchanged
config_version.h.in - for version/hash related variables
----
config_unused.h.in - still generated by autoheader with all
variables, don't use it
Signed-off-by: Aron Budea <aron.budea@collabora.com>
Change-Id: Id9a50a9f1e798a3b3814778d8683b7d7cb57bb29
This improves the performance of fuzzing
and removes the checks that can't be guaranteed.
And fixes a test failure.
Change-Id: I987fe15b098c00d9a3d60077f0581d2ef35e306c
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
This should cap the loop either when we timeout
or when termination is flagged.
Change-Id: I78a6b05df99d6bac5286e4b1e4957829ea91c500
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
This is a full round-trip http fuzzer.
It can achieve >1000 iterations per second
on a single 2 Ghz core, even while going
through the network loopback layer.
The advantage is that more networking code
is fuzzed this way, including not just
the http code, but also the sockets.
Change-Id: I75d21bd0e25221ee6621097a2605d62c4bb2ae4d
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>