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

Protocols.HTTP.Query: Enable timeouts for blocking SSL too.

Non-responsive blocking https requests will now terminate after
the set timeout (default 2 minutes).
parent ffe3cbad
No related branches found
No related tags found
No related merge requests found
...@@ -248,6 +248,11 @@ protected int ponder_answer( int|void start_position ) ...@@ -248,6 +248,11 @@ protected int ponder_answer( int|void start_position )
ok=1; ok=1;
remove_async_timeout(); remove_async_timeout();
TOUCH_TIMEOUT_WATCHDOG(); TOUCH_TIMEOUT_WATCHDOG();
if (con && con->set_timeout) {
// SSL connection.
con->set_timeout((data_timeout || timeout) &&
(float)(data_timeout || timeout));
}
if (request_ok) request_ok(this,@extra_args); if (request_ok) request_ok(this,@extra_args);
return 1; return 1;
...@@ -302,6 +307,8 @@ void start_tls(int|void blocking, int|void async) ...@@ -302,6 +307,8 @@ void start_tls(int|void blocking, int|void async)
ssl->set_blocking(); ssl->set_blocking();
} }
ssl->set_timeout(timeout && (float)timeout);
if (!(ssl_session = ssl->connect(real_host, ssl_session))) { if (!(ssl_session = ssl->connect(real_host, ssl_session))) {
error("HTTPS connection failed.\n"); error("HTTPS connection failed.\n");
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment