]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/filed/verify_vol.c
Use dcr more in SD + int to bool conversions
[bacula/bacula] / bacula / src / filed / verify_vol.c
index 839874e633b81ddffd394d30afe4804becd8b04c..57bcfaf5536b1c1bd8be235d6c041516f0e79870 100644 (file)
@@ -8,7 +8,7 @@
  *
  */
 /*
-   Copyright (C) 2000-2003 Kern Sibbald and John Walker
+   Copyright (C) 2000-2004 Kern Sibbald and John Walker
 
    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License as
@@ -34,9 +34,6 @@
 static char rec_header[] = "rechdr %ld %ld %ld %ld %ld";
 
 /* Forward referenced functions */
-#ifdef needed
-static void print_ls_output(JCR *jcr, char *fname, char *lname, int type, struct stat *statp);
-#endif
 
 
 /* 
@@ -63,7 +60,16 @@ void do_verify_volume(JCR *jcr)
    dir = jcr->dir_bsock;
    set_jcr_job_status(jcr, JS_Running);
 
-   if (!bnet_set_buffer_size(sd, MAX_NETWORK_BUFFER_SIZE, BNET_SETBUF_READ)) {
+   LockRes();
+   CLIENT *client = (CLIENT *)GetNextRes(R_CLIENT, NULL);
+   UnlockRes();
+   uint32_t buf_size;
+   if (client) {
+      buf_size = client->max_network_buffer_size;
+   } else {
+      buf_size = 0;                  /* use default */
+   }
+   if (!bnet_set_buffer_size(sd, buf_size, BNET_SETBUF_WRITE)) {
       set_jcr_job_status(jcr, JS_FatalError);
       return;
    }
@@ -102,7 +108,7 @@ void do_verify_volume(JCR *jcr)
       /* File Attributes stream */
       switch (stream) {
       case STREAM_UNIX_ATTRIBUTES:
-      case STREAM_WIN32_ATTRIBUTES:
+      case STREAM_UNIX_ATTRIBUTES_EX:
         char *ap, *lp, *fp;
 
          Dmsg0(400, "Stream=Unix Attributes.\n");
@@ -246,45 +252,3 @@ ok_out:
    Dmsg2(050, "End Verify-Vol. Files=%d Bytes=%" lld "\n", jcr->JobFiles,
       jcr->JobBytes);
 }         
-
-extern char *getuser(uid_t uid);
-extern char *getgroup(gid_t gid);
-
-/*
- * Print an ls style message, also send INFO
- */
-#ifdef needed
-static void print_ls_output(JCR *jcr, char *fname, char *lname, int type, struct stat *statp)
-{
-   char buf[2000]; 
-   char ec1[30];
-   char *p, *f;
-   int n;
-
-   p = encode_mode(statp->st_mode, buf);
-   n = sprintf(p, "  %2d ", (uint32_t)statp->st_nlink);
-   p += n;
-   n = sprintf(p, "%-8.8s %-8.8s", getuser(statp->st_uid), getgroup(statp->st_gid));
-   p += n;
-   n = sprintf(p, "%8.8s ", edit_uint64(statp->st_size, ec1));
-   p += n;
-   p = encode_time(statp->st_ctime, p);
-   *p++ = ' ';
-   *p++ = ' ';
-   for (f=fname; *f && (p-buf) < (int)sizeof(buf)-10; )
-      *p++ = *f++;
-   if (type == FT_LNK) {
-      *p++ = ' ';
-      *p++ = '-';
-      *p++ = '>';
-      *p++ = ' ';
-      /* Copy link name */
-      for (f=lname; *f && (p-buf) < (int)sizeof(buf)-10; )
-        *p++ = *f++;
-   }
-   *p++ = '\n';
-   *p = 0;
-   Dmsg0(20, buf);
-   Jmsg(jcr, M_INFO, 0, "%s", buf);
-}
-#endif