{"tlscertificate", store_dir, ITEM(res_client.tls_certfile), 0, 0, 0},
{"tlskey", store_dir, ITEM(res_client.tls_keyfile), 0, 0, 0},
{"verid", store_str, ITEM(res_client.verid), 0, 0, 0},
+ {"maximumbandwidth", store_speed, ITEM(res_client.max_bandwidth), 0, 0, 0},
{NULL, NULL, {0}, 0, 0, 0}
};
{"tlskey", store_dir, ITEM(res_dir.tls_keyfile), 0, 0, 0},
{"tlsdhfile", store_dir, ITEM(res_dir.tls_dhfile), 0, 0, 0},
{"tlsallowedcn", store_alist_str, ITEM(res_dir.tls_allowed_cns), 0, 0, 0},
+ {"maximumbandwidth", store_speed, ITEM(res_dir.max_bandwidth), 0, 0, 0},
{NULL, NULL, {0}, 0, 0, 0}
};
char *tls_keyfile; /* TLS Server Key File */
char *tls_dhfile; /* TLS Diffie-Hellman Parameters */
alist *tls_allowed_cns; /* TLS Allowed Clients */
-
+ uint64_t max_bandwidth; /* Bandwidth limitation (per director) */
TLS_CONTEXT *tls_ctx; /* Shared TLS Context */
};
alist *pki_recipients; /* Shared PKI Recipients */
TLS_CONTEXT *tls_ctx; /* Shared TLS Context */
char *verid; /* Custom Id to print in version command */
+ uint64_t max_bandwidth; /* Bandwidth limitation (global) */
};
/* Try to connect for 1 hour at 10 second intervals */
sd->set_source_address(me->FDsrc_addr);
+
+ /* TODO: see if we put limit on restore and backup... */
+ if (jcr->director->max_bandwidth) {
+ sd->set_bwlimit(jcr->director->max_bandwidth);
+
+ } else if (me->max_bandwidth) {
+ sd->set_bwlimit(me->max_bandwidth);
+ }
+
if (!sd->connect(jcr, 10, (int)me->SDConnectTimeout, me->heartbeat_interval,
_("Storage daemon"), jcr->stored_addr, NULL, stored_port, 1)) {
sd->destroy();