summaryrefslogtreecommitdiff
path: root/Libraries/LibCore/CHttpJob.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Libraries/LibCore/CHttpJob.cpp')
-rw-r--r--Libraries/LibCore/CHttpJob.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/Libraries/LibCore/CHttpJob.cpp b/Libraries/LibCore/CHttpJob.cpp
index 472aae01d9..6ddde0475a 100644
--- a/Libraries/LibCore/CHttpJob.cpp
+++ b/Libraries/LibCore/CHttpJob.cpp
@@ -26,6 +26,8 @@ void CHttpJob::on_socket_connected()
return deferred_invoke([this](auto&) { did_fail(CNetworkJob::Error::TransmissionFailed); });
m_socket->on_ready_to_read = [&] {
+ if (is_cancelled())
+ return;
if (m_state == State::InStatus) {
if (!m_socket->can_read_line())
return;
@@ -125,3 +127,12 @@ void CHttpJob::start()
if (!success)
return did_fail(CNetworkJob::Error::ConnectionFailed);
}
+
+void CHttpJob::shutdown()
+{
+ if (!m_socket)
+ return;
+ m_socket->on_ready_to_read = nullptr;
+ m_socket->on_connected = nullptr;
+ m_socket = nullptr;
+}