Skip to content

Commit

Permalink
Merge pull request #310 from bareos/dev/franku/master/stop_timer_befo…
Browse files Browse the repository at this point in the history
…re_return_from_function

stop timer before return from function
  • Loading branch information
franku committed Oct 28, 2019
2 parents c4c8d47 + 4c32d3c commit 5cbe42e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion core/src/lib/bsock.cc
Expand Up @@ -351,6 +351,7 @@ bool BareosSocket::ConsoleAuthenticateWithDirector(
dir->StopTimer();
return false;
}
dir->StopTimer();

Dmsg1(6, ">dird: %s", dir->msg);

Expand Down Expand Up @@ -396,7 +397,10 @@ bool BareosSocket::TwoWayAuthenticate(JobControlRecord* jcr,

btimer_t* tid = StartBsockTimer(this, AUTH_TIMEOUT);

if (ConnectionReceivedTerminateSignal()) { return false; }
if (ConnectionReceivedTerminateSignal()) {
if (tid) { StopBsockTimer(tid); }
return false;
}

auth_success = cram_md5_handshake.DoHandshake(initiated_by_remote);
if (!auth_success) {
Expand Down

0 comments on commit 5cbe42e

Please sign in to comment.