#include "bacula.h"
#include "filed.h"
-#define WAIT_INTERVAL 10
+#define WAIT_INTERVAL 5
extern "C" void *sd_heartbeat_thread(void *arg);
extern "C" void *dir_heartbeat_thread(void *arg);
/* Get our own local copy */
sd = dup_bsock(jcr->store_bsock);
-#ifndef WIN32
- int oflags;
- if ((oflags = fcntl(sd->fd, F_GETFL, 0)) != -1) {
- fcntl(sd->fd, F_SETFL, oflags|O_NONBLOCK);
- }
-#endif
dir = dup_bsock(jcr->dir_bsock);
jcr->hb_bsock = sd;
last_heartbeat = now;
}
}
- if (is_bnet_stop(sd)) {
+ if (n < 0 || is_bnet_stop(sd)) {
break;
}
if (n == 1) { /* input waiting */
Dmsg2(100, "Got %d bytes from SD. MSG=%s\n", sd->msglen, sd->msg);
}
}
- Dmsg2(000, "wait_intr=%d stop=%d\n", n, is_bnet_stop(sd));
+ Dmsg2(100, "wait_intr=%d stop=%d\n", n, is_bnet_stop(sd));
}
bnet_close(sd);
bnet_close(dir);
pthread_kill(jcr->heartbeat_id, TIMEOUT_SIGNAL); /* make heartbeat thread go away */
bmicrosleep(0, 500000);
}
- if (jcr->hb_bsock) {
- }
}
/*