Commit graph

7 commits

Author SHA1 Message Date
Ashod Nakashian
dc5ca2738e wsd: http: simplify appending to Buffer
Instead of supporting char appending,
we now support appending literal strings
with size capturing. This covers both
single- and multi-character appending
without the need for an explicit size.

Change-Id: Iee2c20b7aa2cdb6863c88e91cd770205719c2ba6
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
(cherry picked from commit 96e3e88a014960a5249fc83a5b2f3b785ac8737d)
2021-05-02 22:35:39 -04:00
Ashod Nakashian
5749d7457d wsd: http: improve StatusLine
And update unit-tests.

Change-Id: I29bcb8232c77d3c0c1fe316854417726671765f1
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-03-22 10:09:22 -04:00
Ashod Nakashian
5467a7f7ef wsd: simplify and document dumpHex
Change-Id: I636dd6548b0712a72dfc162eb7381e3e7ac18b5a
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-03-13 19:34:02 -05:00
Michael Meeks
4082975330 Fix unit test to not rely on under-defined behavior.
Change-Id: I4ad9ce7710f7f25884ca2ab31aabd82e2dc5be8e
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
2020-11-29 19:27:23 -05:00
Ashod Nakashian
b87495a791 wsd: test: add Buffer test and minor cosmetics
Change-Id: Ie4ac80984523ecd32fd81238496253b6a4015692
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2020-11-29 19:27:23 -05:00
Michael Meeks
0fc91ef31c Adapt Buffer class to avoid repeated compactions.
Avoid continually shuffling large output buffers down in memory,
it kills CPU caches, does nothing useful, and we can just advance
an offset instead. Of course, we do need to free memory - so do
that for lots of common cases.

Change-Id: I63240661ca87bdc0574acbce856771d9dde3fa94
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
2020-11-29 19:27:23 -05:00
Michael Meeks
e00392647b pure re-factor, creating Buffer class to wrap vector.
For large transfers eg. image previews, particularly with SSL's
protocol limit of 16k byte blocks, we see lots of inefficiency
repeatedly copying a 20Mb image and shuffling it down a
std::vector as we write data out.

Change-Id: I620568cad2e6f41684c35289b0ee77cf7f59c077
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
2020-11-29 19:27:23 -05:00