#endif
}
+void BSOCK::set_killable(bool killable)
+{
+ if (m_jcr) {
+ m_jcr->set_killable(killable);
+ }
+}
+
/*
* Restores socket flags
*/
return false;
}
- dir->stop_timer();
+ dir->stop_timer();
Dmsg1(10, "<dird: %s", dir->msg);
if (strncmp(dir->msg, OKhello, sizeof(OKhello)-1) != 0) {
bsnprintf(response, response_len, _("Director at \"%s:%d\" rejected Hello command\n"),
bsnprintf(response, response_len, _("Authorization problem with Director at \"%s:%d\"\n"
"Most likely the passwords do not agree.\n"
"If you are using TLS, there may have been a certificate validation error during the TLS handshake.\n"
- "Please see http://www.bacula.org/en/rel-manual/Bacula_Freque_Asked_Questi.html#SECTION003760000000000000000 for help.\n"),
+ "Please see " MANUAL_AUTH_URL " for help.\n"),
dir->host(), dir->port());
return false;
}
-
-/* Try to limit the bandwidth of a network connection
- */
-void BSOCK::control_bwlimit(int bytes)
-{
- btime_t now, temp;
- if (bytes == 0) {
- return;
- }
-
- now = get_current_btime(); /* microseconds */
- temp = now - m_last_tick; /* microseconds */
-
- m_nb_bytes += bytes;
-
- /* Less than 0.1ms since the last call, see the next time */
- if (temp < 100) {
- return;
- }
-
- if (temp > 10000000) { /* Take care of clock problems (>10s) */
- m_nb_bytes = bytes;
- m_last_tick = now;
- return;
- }
-
- /* Remove what was authorised to be written in temp us */
- m_nb_bytes -= (int64_t)(temp * ((double)m_bwlimit / 1000000.0));
-
- if (m_nb_bytes < 0) {
- m_nb_bytes = 0;
- }
-
- /* What exceed should be converted in sleep time */
- int64_t usec_sleep = (int64_t)(m_nb_bytes /((double)m_bwlimit / 1000000.0));
- if (usec_sleep > 100) {
- bmicrosleep(0, usec_sleep);
- m_last_tick = get_current_btime();
- m_nb_bytes = 0;
- } else {
- m_last_tick = now;
- }
-}