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 already have an http response instance (in all but
one case, prior to this change), there is no need to pass
the mime-type explicitly to the sendFileAndShutdown
function, only to set it on the http response.
There are already too many arguments and the mime-type
is surely redundant.
Change-Id: Iab64074dc111573b87fb8fa9b907c26a4160910c
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
std::make_shared and std::make_unique
are superior to explict smart pointer
construction. Where we have private
constructors, we can't use them.
Change-Id: I492122f58e958113c6e6d31445c6614ad98c89aa
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
If the connection is closed right after the response was sent
then it's wise to add 'Connection: close' header to the response
so that the client optimizes its behaviour: e.g. does not reuse
the socket for further http requests. Normally a client should
retry a request if the reuse of an old socket fails and that
should solve the problem but still this is an overhead.
Signed-off-by: Gabriel Masei <gabriel.masei@1and1.ro>
Change-Id: I29f1498610c567024def3beb1ad7014f2c15a232
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
Also clear its input buffer explicitly.
Change-Id: I8badbb96d98eaf10433a65fcfd13b0d6d5893594
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
Ignore input in a somewhat gentler way.
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
Change-Id: I758302dc3bb1aa87f9fbfa726f73f4b9339e08c2
This is non-functional change to have all HttpHelper
members in a single place (HttpHelper.cpp).
Clang-format is applied and FileUtil::Stat is used
instead of a naked stat(2).
Change-Id: I663e2eb3070e873bd1f4477b60e45b0086d29f4e
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>