NetServices: Notify any async listeners when a request completes early.

The API allows a user to end parsing responses earlier if the response has a
client (4xx) or server (5xx) error code. The end user should still be notified
of this result, so that they can act.

Change-Id: I11f2ab296658f767b5b34e10badb54de27aab494
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5910
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
This commit is contained in:
Niels Sascha Reedijk 2022-12-13 21:45:52 +00:00 committed by waddlesplash
parent 76ddb69a3a
commit b70a0efa9e

View File

@ -888,6 +888,8 @@ BHttpSession::Request::ReceiveResult()
fResult->SetStatus(std::move(fStatus));
fResult->SetFields(BHttpFields());
fResult->SetBody();
SendMessage(UrlEvent::RequestCompleted,
[](BMessage& msg) { msg.AddBool(UrlEventData::Success, true); });
return true;
}