wsd: tolerate missing FinishedCallback in http::Response
And explain the use of linear search in header(). Change-Id: If6c39bffa738861d0c86684f9560ed6e4a6970e1 Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
This commit is contained in:
parent
69436ed0f3
commit
725a3070c3
1 changed files with 5 additions and 1 deletions
|
@ -306,6 +306,9 @@ public:
|
|||
|
||||
std::string get(const std::string& key) const
|
||||
{
|
||||
// There are typically half a dozen header
|
||||
// entries, rarely much more. A map would
|
||||
// probably not be faster but would add complexity.
|
||||
for (const auto& pair : _headers)
|
||||
{
|
||||
if (pair.first == key)
|
||||
|
@ -761,7 +764,8 @@ private:
|
|||
LOG_TRC("Finishing");
|
||||
_bodyFile.close();
|
||||
_state = newState;
|
||||
_finishedCallback();
|
||||
if (_finishedCallback)
|
||||
_finishedCallback();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue