Skip to content
Snippets Groups Projects
Commit e02353e2 authored by Henrik (Grubba) Grubbström's avatar Henrik (Grubba) Grubbström
Browse files

Merge branch 'patches/pike84' into 8.0

* patches/pike84:
  Protocols.HTTP.Query: Do not wait for close() to complete.
parents 97adf68f b4ffc568
No related merge requests found
......@@ -207,12 +207,28 @@ protected int ponder_answer( int|void start_position )
return 1;
}
protected void close_connection()
protected void close_connection(int|void terminate_now)
{
Stdio.File con = this::con;
object(Stdio.File)|SSL.File con = this::con;
if (!con) return;
this::con = 0;
con->set_callbacks(0, 0, 0, 0, 0); // Clear any remaining callbacks.
if (terminate_now) {
// We don't want to wait for the close() to complete...
con->set_nonblocking();
con->close();
if (!con->shutdown) return;
// Probably SSL.
//
// Force the connection to shutdown.
con = con->shutdown();
if (!con) return;
}
con->close();
}
......@@ -1252,8 +1268,12 @@ protected void destroy()
remove_call_out(async_id);
}
async_id = 0;
if(async_dns) {
async_dns->close();
async_dns = 0;
}
catch(close());
catch(close_connection(1));
}
//! Close all associated file descriptors.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment