]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/lib/bsock.c
Fix get_basename() -- rewrite
[bacula/bacula] / bacula / src / lib / bsock.c
index 13958a9a98483212d463bd780b59d08daedd91e6..2fee52365d241c5d34ca60419830af5e984f5e84 100644 (file)
@@ -811,6 +811,13 @@ int BSOCK::set_blocking()
 #endif
 }
 
+void BSOCK::set_killable(bool killable)
+{
+   if (m_jcr) {
+      m_jcr->set_killable(killable);
+   }
+}
+
 /*
  * Restores socket flags
  */
@@ -1035,7 +1042,7 @@ bool BSOCK::authenticate_director(const char *name, const char *password,
       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"),
@@ -1051,50 +1058,7 @@ bail_out:
    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;
-   }
-}