summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibProtocol
diff options
context:
space:
mode:
authorAli Mohammad Pur <ali.mpfard@gmail.com>2022-02-18 15:37:51 +0330
committerAndreas Kling <kling@serenityos.org>2022-02-18 13:19:26 +0100
commit8fa334a70cae67cb8b6403584f2f1c1ac86b627d (patch)
treed6dfc0ae3221f140b6eea6cde1ad424cfcdbef05 /Userland/Libraries/LibProtocol
parent0e173da86fe93fd0c87257e8f68cc6fedc4c59e7 (diff)
downloadserenity-8fa334a70cae67cb8b6403584f2f1c1ac86b627d.zip
LibProtocol: Close the stream notifier unconditionally on EOF
We shouldn't wait for on_finish to close the read notifier, we'll get the finished message when we do, no need to spin waiting for it.
Diffstat (limited to 'Userland/Libraries/LibProtocol')
-rw-r--r--Userland/Libraries/LibProtocol/Request.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/Userland/Libraries/LibProtocol/Request.cpp b/Userland/Libraries/LibProtocol/Request.cpp
index bf506c2582..6fa59bad17 100644
--- a/Userland/Libraries/LibProtocol/Request.cpp
+++ b/Userland/Libraries/LibProtocol/Request.cpp
@@ -60,10 +60,11 @@ void Request::stream_into_impl(T& stream)
}
} while (true);
- if (m_internal_stream_data->read_stream->is_eof() && m_internal_stream_data->request_done) {
+ if (m_internal_stream_data->read_stream->is_eof())
m_internal_stream_data->read_notifier->close();
+
+ if (m_internal_stream_data->request_done)
m_internal_stream_data->on_finish();
- }
};
}