Skip to content

Commit

Permalink
LibProtocol: Close the stream notifier unconditionally on EOF
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
alimpfard authored and awesomekling committed Feb 18, 2022
1 parent 0e173da commit 8fa334a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Userland/Libraries/LibProtocol/Request.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
};
}

Expand Down

0 comments on commit 8fa334a

Please sign in to comment.