]> git.sur5r.net Git - bacula/bacula/commitdiff
Minor fixes.
authorNicolas Boichat <nicolas@boichat.ch>
Sun, 25 Apr 2004 10:51:40 +0000 (10:51 +0000)
committerNicolas Boichat <nicolas@boichat.ch>
Sun, 25 Apr 2004 10:51:40 +0000 (10:51 +0000)
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@1301 91ce42f0-d328-0410-95d8-f526ca767f89

bacula/src/wx-console/console_thread.cpp
bacula/src/wx-console/wxbutils.cpp

index d459f2fa5c2c5199151821dd65ad1c43d5066a6a..3e5954698313b8ddad5d73db2feb88d241529536 100644 (file)
@@ -57,6 +57,12 @@ console_thread::~console_thread() {
       bnet_close(UA_sock);
       UA_sock = NULL;
    }
+   if (WSACleanup() == 0) {
+      //csprint("Windows sockets cleaned up successfully...\n");
+   }
+   else {
+      csprint("Error while cleaning up windows sockets...\n");
+   }
 }
 
 /*
@@ -68,9 +74,8 @@ void* console_thread::Entry() {
    }
    else {
       csprint("Error while initializing windows sockets...\n");
-      return 0;
    }
-   
+
    csprint("Connecting...\n");
 
    init_stack_dump();
@@ -86,10 +91,14 @@ void* console_thread::Entry() {
    UnlockRes();
 
    memset(&jcr, 0, sizeof(jcr));
+   
+   jcr.dequeuing = 1; /* TODO: catch messages */
 
    UA_sock = bnet_connect(&jcr, 3, 3, "Director daemon", dir->address, NULL, dir->DIRport, 0);
    if (UA_sock == NULL) {
       csprint("Failed to connect to the director\n");
+      csprint(NULL, CS_END);
+      csprint(NULL, CS_DISCONNECTED);
       return NULL;
    }
 
@@ -99,6 +108,8 @@ void* console_thread::Entry() {
    if (!authenticate_director(&jcr, dir, NULL)) {
       csprint("ERR=");
       csprint(UA_sock->msg);
+      csprint(NULL, CS_END);
+      csprint(NULL, CS_DISCONNECTED);
       return NULL;
    }
    
@@ -147,13 +158,6 @@ void* console_thread::Entry() {
    
    UA_sock = NULL;
    
-   if (WSACleanup() == 0) {
-      //csprint("Windows sockets cleaned up successfully...\n");
-   }
-   else {
-      csprint("Error while cleaning up windows sockets...\n");
-   }
-
    return 0;
 }
 
index 0c1c65b16cf3d449929e1db3813e5d0514aa9857..ab69ad2cafa58abb6d93ae4e9e4f50dad827d84d 100644 (file)
@@ -164,7 +164,7 @@ bool wxbPromptParser::Analyse(wxString str, int status) {
             choices->Add(""); /* index 0 is never used by multiple choice questions */
          }
          
-         if (choices->GetCount() != num) { /* new choice has begun */
+         if ((long)choices->GetCount() != num) { /* new choice has begun */
             delete choices;
             choices = new wxArrayString(num);
             choices->Add("", num); /* fill until this number */