/*
Bacula(R) - The Network Backup Solution
- Copyright (C) 2000-2016 Kern Sibbald
+ Copyright (C) 2000-2017 Kern Sibbald
The original author of Bacula is Kern Sibbald, with contributions
from many others, a complete list can be found in the file AUTHORS.
/*
* Version at end of Hello
* prior to 06Aug13 no version
+ * 100 14Feb17 - added comm line compression
*/
#define UA_VERSION 100
/* Response from Director */
static char oldOKhello[] = "1000 OK:";
static char newOKhello[] = "1000 OK: %d";
+static char FDOKhello[] = "2000 OK Hello %d";
/* Forward referenced functions */
bool tls_authenticate;
int compatible = true;
int dir_version = 0;
+ int fd_version = 0;
char bashed_name[MAX_NAME_LENGTH];
char *password;
TLS_CONTEXT *tls_ctx = NULL;
-
+
/*
* Send my name to the Director then do authentication
*/
}
Dmsg1(10, "<dird: %s", dir->msg);
- if (strncmp(dir->msg, oldOKhello, sizeof(oldOKhello)-1) != 0) {
- sendit(_("Director rejected Hello command\n"));
- goto bail_out;
- } else {
+ if (strncmp(dir->msg, oldOKhello, sizeof(oldOKhello)-1) == 0) {
/* If Dir version exists, get it */
sscanf(dir->msg, newOKhello, &dir_version);
sendit(dir->msg);
+ /* Check for hello from FD */
+ } else if (sscanf(dir->msg, FDOKhello, &fd_version) == 1) {
+ sendit(dir->msg);
+ } else {
+ sendit(_("Director rejected Hello command\n"));
+ goto bail_out;
+ }
+ /* Turn on compression for newer Directors */
+ if (dir_version >= 103 && (!cons || cons->comm_compression)) {
+ dir->set_compress();
+ } else {
+ dir->clear_compress();
}
+ /* ***FIXME*** should turn on compression for FD if possible */
stop_bsock_timer(tid);
return 1;