Skip to content

Commit

Permalink
socket-server: wait 250ms before trying TLS handshake
Browse files Browse the repository at this point in the history
- try to solve the race condition when running a backup on FreeBSD
- the psk-callback cannot find the psk for the storage in the
  respective job control record
  • Loading branch information
franku committed Dec 14, 2018
1 parent afb5bdf commit d1f16be
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions core/src/dird/socket_server.cc
Expand Up @@ -77,6 +77,8 @@ static void *HandleConnectionRequest(ConfigurationParser *config, void *arg)

jcr.ua = bs;

Bmicrosleep(0,250000);

if (!TryTlsHandshakeAsAServer(bs, config)) {
bs->signal(BNET_TERMINATE);
bs->close();
Expand Down
2 changes: 2 additions & 0 deletions core/src/filed/socket_server.cc
Expand Up @@ -59,6 +59,8 @@ static void *HandleConnectionRequest(ConfigurationParser *config, void *arg)
{
BareosSocket *bs = (BareosSocket *)arg;

Bmicrosleep(0,250000);

if (!TryTlsHandshakeAsAServer(bs, config)) {
bs->signal(BNET_TERMINATE);
bs->close();
Expand Down
2 changes: 2 additions & 0 deletions core/src/stored/socket_server.cc
Expand Up @@ -67,6 +67,8 @@ void *HandleConnectionRequest(ConfigurationParser *config, void *arg)
char name[MAX_NAME_LENGTH];
char tbuf[MAX_TIME_LENGTH];

Bmicrosleep(0,250000);

if (!TryTlsHandshakeAsAServer(bs, config)) {
bs->signal(BNET_TERMINATE);
bs->close();
Expand Down

0 comments on commit d1f16be

Please sign in to comment.