]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/dird/getmsg.c
kes Fix %g in filename returned by SQL for browse tree reported by
[bacula/bacula] / bacula / src / dird / getmsg.c
index 4a7b758c939865f8208f6cd6da40d6e921aed48e..ae4a190bf6dc30f94bc35896a7f479eba16c4666 100644 (file)
@@ -1,36 +1,14 @@
-/*
- *
- *   Bacula Director -- routines to receive network data and
- *    handle network signals. These routines handle the connections
- *    to the Storage daemon and the File daemon.
- *
- *     Kern Sibbald, August MM
- *
- *    This routine runs as a thread and must be thread reentrant.
- *
- *  Basic tasks done here:
- *    Handle  network signals (signals).
- *       Signals always have return status 0 from bnet_recv() and
- *       a zero or negative message length.
- *    Pass appropriate messages back to the caller (responses).
- *       Responses always have a digit as the first character.
- *    Handle requests for message and catalog services (requests).
- *       Requests are any message that does not begin with a digit.
- *       In affect, they are commands.
- *
- *   Version $Id$
- */
 /*
    Bacula® - The Network Backup Solution
 
-   Copyright (C) 2000-2006 Free Software Foundation Europe e.V.
+   Copyright (C) 2000-2007 Free Software Foundation Europe e.V.
 
    The main author of Bacula is Kern Sibbald, with contributions from
    many others, a complete list can be found in the file AUTHORS.
    This program is Free Software; you can redistribute it and/or
    modify it under the terms of version two of the GNU General Public
-   License as published by the Free Software Foundation plus additions
-   that are listed in the file LICENSE.
+   License as published by the Free Software Foundation and included
+   in the file LICENSE.
 
    This program is distributed in the hope that it will be useful, but
    WITHOUT ANY WARRANTY; without even the implied warranty of
    (FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich,
    Switzerland, email:ftf@fsfeurope.org.
 */
+/*
+ *
+ *   Bacula Director -- routines to receive network data and
+ *    handle network signals. These routines handle the connections
+ *    to the Storage daemon and the File daemon.
+ *
+ *     Kern Sibbald, August MM
+ *
+ *    This routine runs as a thread and must be thread reentrant.
+ *
+ *  Basic tasks done here:
+ *    Handle  network signals (signals).
+ *       Signals always have return status 0 from bnet_recv() and
+ *       a zero or negative message length.
+ *    Pass appropriate messages back to the caller (responses).
+ *       Responses always have a digit as the first character.
+ *    Handle requests for message and catalog services (requests).
+ *       Requests are any message that does not begin with a digit.
+ *       In affect, they are commands.
+ *
+ *   Version $Id$
+ */
 
 #include "bacula.h"
 #include "dird.h"
@@ -106,8 +106,8 @@ int bget_dirmsg(BSOCK *bs)
    char *msg;
 
    for (;;) {
-      n = bnet_recv(bs);
-      Dmsg2(900, "bget_dirmsg %d: %s", n, bs->msg);
+      n = bs->recv();
+      Dmsg2(100, "bget_dirmsg %d: %s", n, bs->msg);
 
       if (is_bnet_stop(bs)) {
          return n;                    /* error or terminate */
@@ -118,13 +118,13 @@ int bget_dirmsg(BSOCK *bs)
          case BNET_EOD:            /* end of data */
             return n;
          case BNET_EOD_POLL:
-            bnet_fsend(bs, OK_msg);/* send response */
+            bs->fsend(OK_msg);/* send response */
             return n;              /* end of data */
          case BNET_TERMINATE:
-            bs->terminated = 1;
+            bs->set_terminated();
             return n;
          case BNET_POLL:
-            bnet_fsend(bs, OK_msg); /* send response */
+            bs->fsend(OK_msg); /* send response */
             break;
          case BNET_HEARTBEAT:
 //          encode_time(time(NULL), Job);
@@ -134,12 +134,12 @@ int bget_dirmsg(BSOCK *bs)
             break;
          case BNET_STATUS:
             /* *****FIXME***** Implement more completely */
-            bnet_fsend(bs, "Status OK\n");
-            bnet_sig(bs, BNET_EOD);
+            bs->fsend("Status OK\n");
+            bs->signal(BNET_EOD);
             break;
          case BNET_BTIME:             /* send Bacula time */
             char ed1[50];
-            bnet_fsend(bs, "btime %s\n", edit_uint64(get_current_btime(),ed1));
+            bs->fsend("btime %s\n", edit_uint64(get_current_btime(),ed1));
             break;
          default:
             Emsg1(M_WARNING, 0, _("bget_dirmsg: unknown bnet signal %d\n"), bs->msglen);