mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-21 15:10:19 +00:00
LibRequests: Don't crash on requests without a read stream finishing
This can now happen due to the hostname not existing, as RS explicitly performs DNS resolution before setting up the response pipe.
This commit is contained in:
parent
7e20f4726f
commit
879ae94183
Notes:
github-actions[bot]
2024-11-20 20:44:20 +00:00
Author: https://github.com/alimpfard Commit: https://github.com/LadybirdBrowser/ladybird/commit/879ae94183a Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2111 Reviewed-by: https://github.com/ADKaster ✅
1 changed files with 1 additions and 1 deletions
|
@ -123,7 +123,7 @@ void Request::set_up_internal_stream_data(DataReceived on_data_available)
|
|||
};
|
||||
|
||||
m_internal_stream_data->on_finish = [this, user_on_finish = move(user_on_finish)]() {
|
||||
if (!m_internal_stream_data->user_finish_called && m_internal_stream_data->read_stream->is_eof()) {
|
||||
if (!m_internal_stream_data->user_finish_called && (!m_internal_stream_data->read_stream || m_internal_stream_data->read_stream->is_eof())) {
|
||||
m_internal_stream_data->user_finish_called = true;
|
||||
user_on_finish(m_internal_stream_data->total_size, m_internal_stream_data->network_error);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue