mirror of
https://github.com/OpenVPN/openvpn3.git
synced 2024-09-20 20:13:05 +02:00
httpcli: added cancel_general_timeout.
Also: CoarseTimer must always be reset when its associated AsioTimer is cancelled. Signed-off-by: James Yonan <james@openvpn.net>
This commit is contained in:
parent
4aa8f0b54a
commit
01ef08b0e2
@ -379,6 +379,7 @@ namespace openvpn {
|
||||
|
||||
void streaming_start()
|
||||
{
|
||||
cancel_general_timeout();
|
||||
content_out_hold = false;
|
||||
if (is_deferred())
|
||||
http_content_out_needed();
|
||||
@ -474,7 +475,10 @@ namespace openvpn {
|
||||
}
|
||||
}
|
||||
else if (init)
|
||||
general_timer.cancel();
|
||||
{
|
||||
general_timeout_coarse.reset();
|
||||
general_timer.cancel();
|
||||
}
|
||||
}
|
||||
|
||||
void handle_request() // called by Asio
|
||||
@ -491,6 +495,7 @@ namespace openvpn {
|
||||
general_timeout_duration = Time::Duration::seconds(to.general >= 0
|
||||
? to.general
|
||||
: config->general_timeout);
|
||||
general_timeout_coarse.reset();
|
||||
activity(true);
|
||||
|
||||
if (alive)
|
||||
@ -720,6 +725,12 @@ namespace openvpn {
|
||||
keepalive_timer->cancel();
|
||||
}
|
||||
|
||||
void cancel_general_timeout()
|
||||
{
|
||||
general_timeout_duration.set_zero();
|
||||
general_timer.cancel();
|
||||
}
|
||||
|
||||
void general_timeout_handler(const openvpn_io::error_code& e) // called by Asio
|
||||
{
|
||||
if (!halt && !e)
|
||||
|
Loading…
Reference in New Issue
Block a user