]> git.sur5r.net Git - bacula/bacula/commitdiff
07Jan06
authorKern Sibbald <kern@sibbald.com>
Sat, 7 Jan 2006 15:02:14 +0000 (15:02 +0000)
committerKern Sibbald <kern@sibbald.com>
Sat, 7 Jan 2006 15:02:14 +0000 (15:02 +0000)
- Add PoolId to Job record when updating it at job start time.
06Jan06
- Pull in more code from 1.39 so that there are fewer file
  differences (the new ua_dotcmds.c, base64.h, crypto.h
  hmac.c jcr.c (dird and lib) lib.h md5.h parse_conf.c
  util.c. Aside from ua_dotcmds.c these are mostly crypto
  upgrades.
- Implement new method of walking the jcr chain. The
  incr/dec of the use_count is done within the walking
  routines.  This should prevent a jcr from being freed
  from under the walk routines.

git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@2722 91ce42f0-d328-0410-95d8-f526ca767f89

22 files changed:
bacula/examples/autochangers/chio-changer
bacula/kernstodo
bacula/kes-1.38
bacula/src/cats/sql_update.c
bacula/src/dird/backup.c
bacula/src/dird/dird.c
bacula/src/dird/job.c
bacula/src/dird/pythondir.c
bacula/src/dird/ua_cmds.c
bacula/src/dird/ua_status.c
bacula/src/filed/status.c
bacula/src/jcr.h
bacula/src/lib/Makefile.in
bacula/src/lib/base64.h
bacula/src/lib/crypto.h
bacula/src/lib/jcr.c
bacula/src/lib/lib.h
bacula/src/lib/protos.h
bacula/src/lib/util.c
bacula/src/stored/block.h
bacula/src/stored/status.c
bacula/src/version.h

index 5437cba65f58c60980c654f20085060fcba9b959..60b2d5395e73b4b0cc9f70939798ac08e916116f 100644 (file)
@@ -120,6 +120,6 @@ case "$COMMAND" in
       ;;
 
    slots)
-      ${MTX} -f $CHANGER status slot  | wc -l
+      ${MTX} -f $CHANGER status slot  | wc -l | bc
       ;;
 esac
index b2a4fb393bfc79fb83bb7d0e1cd24f785ca551f6..ce5d91d32a364e171134397641813707234f5133 100644 (file)
@@ -1,5 +1,5 @@
                     Kern's ToDo List
-                     26 December 2005
+                     07 January 2006
 
 Major development:      
 Project                     Developer
@@ -1271,3 +1271,9 @@ Block Position: 0
 === Done
 - Make sure that all do_prompt() calls in Dir check for
   -1 (error) and -2 (cancel) returns.
+- Fix foreach_jcr() to have free_jcr() inside next().
+  jcr=jcr_walk_start();
+  for ( ; jcr; (jcr=jcr_walk_next(jcr)) )
+  ...
+  jcr_walk_end(jcr);
+
index d5b5a4e7a775a97986641a09c70cca99e3fb29f5..bec8fbcee7c8557efc891e70188ab139d7777aff 100644 (file)
@@ -3,6 +3,20 @@
 
 General:
 
+1.38.4:
+07Jan06
+- Add PoolId to Job record when updating it at job start time.
+06Jan06
+- Pull in more code from 1.39 so that there are fewer file
+  differences (the new ua_dotcmds.c, base64.h, crypto.h
+  hmac.c jcr.c (dird and lib) lib.h md5.h parse_conf.c 
+  util.c. Aside from ua_dotcmds.c these are mostly crypto
+  upgrades.
+- Implement new method of walking the jcr chain. The
+  incr/dec of the use_count is done within the walking
+  routines.  This should prevent a jcr from being freed
+  from under the walk routines.
+
 Release 1.38.3 05Jan06:
 04Jan06
 - Move the suitable_drive flag to a better place to prevent
index 5972e101bf9be4dcc7d2bb5160357a36c7667d00..e008a609139cdc75f7d3265cb5f8c253408a2463 100644 (file)
@@ -6,7 +6,7 @@
  *    Version $Id$
  */
 /*
-   Copyright (C) 2000-2005 Kern Sibbald
+   Copyright (C) 2000-2006 Kern Sibbald
 
    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License
@@ -20,7 +20,6 @@
 
  */
 
-
 /* The following is necessary so that we do not include
  * the dummy external definition of DB.
  */
@@ -54,7 +53,7 @@ db_add_digest_to_file_record(JCR *jcr, B_DB *mdb, FileId_t FileId, char *digest,
                           int type)
 {
    int stat;
-   char ed1[CRYPTO_DIGEST_MAX_SIZE];
+   char ed1[50];
 
    db_lock(mdb);
    Mmsg(mdb->cmd, "UPDATE File SET MD5='%s' WHERE FileId=%s", digest, 
@@ -94,7 +93,7 @@ db_update_job_start_record(JCR *jcr, B_DB *mdb, JOB_DBR *jr)
    struct tm tm;
    btime_t JobTDate;
    int stat;
-   char ed1[50], ed2[50], ed3[50];
+   char ed1[50], ed2[50], ed3[50], ed4[50];
 
    stime = jr->StartTime;
    localtime_r(&stime, &tm);
@@ -103,12 +102,13 @@ db_update_job_start_record(JCR *jcr, B_DB *mdb, JOB_DBR *jr)
 
    db_lock(mdb);
    Mmsg(mdb->cmd, "UPDATE Job SET JobStatus='%c',Level='%c',StartTime='%s',"
-"ClientId=%s,JobTDate=%s WHERE JobId=%s",
+"ClientId=%s,JobTDate=%s,PoolId=%s WHERE JobId=%s",
       (char)(jcr->JobStatus),
       (char)(jr->JobLevel), dt, 
       edit_int64(jr->ClientId, ed1),
       edit_uint64(JobTDate, ed2), 
-      edit_int64(jr->JobId, ed3));
+      edit_int64(jr->JobId, ed3),
+      edit_int64(jr->PoolId, ed4));
 
    stat = UPDATE_DB(jcr, mdb, mdb->cmd);
    mdb->changes = 0;
index f9bb0e0e3ca7acbbcb02e82ac2555bf80eeb8c55..cbc95c61e78e9f8463fe342f2d99dd0597600caa 100644 (file)
@@ -14,7 +14,7 @@
  *   Version $Id$
  */
 /*
-   Copyright (C) 2000-2005 Kern Sibbald
+   Copyright (C) 2000-2006 Kern Sibbald
 
    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License
@@ -100,6 +100,9 @@ bool do_backup_init(JCR *jcr)
    jcr->PoolId = pr.PoolId;
    jcr->jr.PoolId = pr.PoolId;
 
+   /*
+    * Fire off any clone jobs (run directives)
+    */
    Dmsg2(900, "cloned=%d run_cmds=%p\n", jcr->cloned, jcr->job->run_cmds);
    if (!jcr->cloned && jcr->job->run_cmds) {
       char *runcmd;
index 20b32fcdd7c8cf5b47044103c7df2132bcd84581..63a3b1ea8ac873ed4a9df9274d4d8953174dfeab 100644 (file)
@@ -7,7 +7,7 @@
  *   Version $Id$
  */
 /*
-   Copyright (C) 2000-2005 Kern Sibbald
+   Copyright (C) 2000-2006 Kern Sibbald
 
    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License
@@ -431,8 +431,8 @@ void reload_config(int sig)
             job_end_push(jcr, reload_job_end_cb, (void *)((long int)table));
             njobs++;
          }
-         free_jcr(jcr);
       }
+      endeach_jcr(jcr);
    }
 
    /* Reset globals */
index 13a52f09ac333d99e4e484843895ea579bc29a52..6c12e089ce8474104b64138c061bcbb65fc450a1 100644 (file)
@@ -427,7 +427,7 @@ bool cancel_job(UAContext *ua, JCR *jcr)
 
 static void job_monitor_destructor(watchdog_t *self)
 {
-   JCR *control_jcr = (JCR *) self->data;
+   JCR *control_jcr = (JCR *)self->data;
 
    free_jcr(control_jcr);
 }
@@ -446,8 +446,6 @@ static void job_monitor_watchdog(watchdog_t *self)
       if (jcr->JobId == 0) {
          Dmsg2(800, "Skipping JCR %p (%s) with JobId 0\n",
                jcr, jcr->Job);
-         /* Keep reference counts correct */
-         free_jcr(jcr);
          continue;
       }
 
@@ -466,12 +464,12 @@ static void job_monitor_watchdog(watchdog_t *self)
          cancel_job(ua, jcr);
          free_ua_context(ua);
 
-         Dmsg1(800, "Have cancelled JCR %p\n", jcr);
+         Dmsg2(800, "Have cancelled JCR %p Job=%d\n", jcr, jcr->JobId);
       }
 
       /* Keep reference counts correct */
-      free_jcr(jcr);
    }
+   endeach_jcr(jcr);
 }
 
 /*
index c47ba6a464478cb3b29ef0141c7e42a7bdc10215..17e2f58984062fad96eded91da308bc6d7576b2e 100644 (file)
@@ -8,7 +8,7 @@
  *
  */
 /*
-   Copyright (C) 2004-2005 Kern Sibbald
+   Copyright (C) 2004-2006 Kern Sibbald
 
    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License
@@ -337,7 +337,6 @@ static PyObject *job_cancel(PyObject *self, PyObject *args)
    }
    foreach_jcr(jcr) {
       if (jcr->JobId == 0) {
-         free_jcr(jcr);
          continue;
       }
       if (jcr->JobId == JobId) {
@@ -345,6 +344,8 @@ static PyObject *job_cancel(PyObject *self, PyObject *args)
          break;
       }
    }
+   /* endeach_jcr(jcr) not needed because freed below */
+
    if (!found) {
       /* ***FIXME*** raise exception */
       return NULL;
index 734943bb497642b17415d9f9c9dcf4ea4784f41d..8a224741f7d8d185d7edfc9aa42d4855466db635 100644 (file)
@@ -7,7 +7,7 @@
  *   Version $Id$
  */
 /*
-   Copyright (C) 2000-2005 Kern Sibbald
+   Copyright (C) 2000-2006 Kern Sibbald
 
    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License
@@ -402,12 +402,11 @@ static int cancel_cmd(UAContext *ua, const char *cmd)
       /* Count Jobs running */
       foreach_jcr(jcr) {
          if (jcr->JobId == 0) {      /* this is us */
-            free_jcr(jcr);
             continue;
          }
-         free_jcr(jcr);
          njobs++;
       }
+      endeach_jcr(jcr);
 
       if (njobs == 0) {
          bsendmsg(ua, _("No Jobs running.\n"));
@@ -417,13 +416,12 @@ static int cancel_cmd(UAContext *ua, const char *cmd)
       foreach_jcr(jcr) {
          char ed1[50];
          if (jcr->JobId == 0) {      /* this is us */
-            free_jcr(jcr);
             continue;
          }
          bsnprintf(buf, sizeof(buf), _("JobId=%s Job=%s"), edit_int64(jcr->JobId, ed1), jcr->Job);
          add_prompt(ua, buf);
-         free_jcr(jcr);
       }
+      endeach_jcr(jcr);
 
       if (do_prompt(ua, _("Job"),  _("Choose Job to cancel"), buf, sizeof(buf)) < 0) {
          return 1;
@@ -1356,11 +1354,11 @@ int wait_cmd(UAContext *ua, const char *cmd)
       foreach_jcr(jcr) {
          if (jcr->JobId != 0) {
             running = true;
-            free_jcr(jcr);
             break;
          }
-         free_jcr(jcr);
       }
+      endeach_jcr(jcr);
+
       if (running) {
          bmicrosleep(1, 0);
       }
index d242f6ff2b4a77e866bcc75e22b13c576bac838f..b8ade96e21b56a808347f265b426dfc309ced0d6 100644 (file)
@@ -7,7 +7,7 @@
  *   Version $Id$
  */
 /*
-   Copyright (C) 2001-2005 Kern Sibbald
+   Copyright (C) 2001-2006 Kern Sibbald
 
    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License
@@ -66,8 +66,8 @@ int qstatus_cmd(UAContext *ua, const char *cmd)
             bsendmsg(ua, DotStatusJob, edit_int64(njcr->JobId, ed1), 
                      njcr->JobStatus, njcr->JobErrors);
          }
-         free_jcr(njcr);
       }
+      endeach_jcr(njcr);
    } else if (strcasecmp(ua->argk[2], "last") == 0) {
       bsendmsg(ua, OKqstatus, ua->argk[2]);
       if ((last_jobs) && (last_jobs->size() > 0)) {
@@ -507,7 +507,6 @@ static void list_running_jobs(UAContext *ua)
    Dmsg0(200, "enter list_run_jobs()\n");
    bsendmsg(ua, _("\nRunning Jobs:\n"));
    foreach_jcr(jcr) {
-      njobs++;
       if (jcr->JobId == 0) {      /* this is us */
          /* this is a console or other control job. We only show console
           * jobs in the status output.
@@ -516,10 +515,12 @@ static void list_running_jobs(UAContext *ua)
             bstrftime_nc(dt, sizeof(dt), jcr->start_time);
             bsendmsg(ua, _("Console connected at %s\n"), dt);
          }
-         njobs--;
-      }
-      free_jcr(jcr);
+         continue;
+      }       
+      njobs++;
    }
+   endeach_jcr(jcr);
+
    if (njobs == 0) {
       /* Note the following message is used in regress -- don't change */
       bsendmsg(ua, _("No Jobs running.\n====\n"));
@@ -531,7 +532,6 @@ static void list_running_jobs(UAContext *ua)
    bsendmsg(ua, _("======================================================================\n"));
    foreach_jcr(jcr) {
       if (jcr->JobId == 0 || !acl_access_ok(ua, Job_ACL, jcr->job->hdr.name)) {
-         free_jcr(jcr);
          continue;
       }
       njobs++;
@@ -650,8 +650,8 @@ static void list_running_jobs(UAContext *ua)
          free_pool_memory(emsg);
          pool_mem = false;
       }
-      free_jcr(jcr);
    }
+   endeach_jcr(jcr);
    bsendmsg(ua, _("====\n"));
    Dmsg0(200, "leave list_run_jobs()\n");
 }
index fdeb2abf57f58690018a8fc633883c2266e922f2..ede4e6d987c4611d16045643feb830eb76fd2770 100755 (executable)
@@ -7,7 +7,7 @@
  *
  */
 /*
-   Copyright (C) 2001-2005 Kern Sibbald
+   Copyright (C) 2001-2006 Kern Sibbald
 
    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License
@@ -156,7 +156,6 @@ static void do_status(void sendit(const char *msg, int len, void *sarg), void *a
       }
       sendit(msg, len, arg);
       if (njcr->JobId == 0) {
-         free_jcr(njcr);
          continue;
       }
       sec = time(NULL) - njcr->start_time;
@@ -188,8 +187,9 @@ static void do_status(void sendit(const char *msg, int len, void *sarg), void *a
          len = Mmsg(msg, _("    SDSocket closed.\n"));
          sendit(msg, len, arg);
       }
-      free_jcr(njcr);
    }
+   endeach_jcr(njcr);
+
    Dmsg0(1000, "Begin status jcr loop.\n");
    if (!found) {
       len = Mmsg(msg, _("No Jobs running.\n"));
@@ -334,8 +334,8 @@ int qstatus_cmd(JCR *jcr)
          if (njcr->JobId != 0) {
             bnet_fsend(dir, DotStatusJob, njcr->JobId, njcr->JobStatus, njcr->JobErrors);
          }
-         free_jcr(njcr);
       }
+      endeach_jcr(njcr);
    } else if (strcmp(time, "last") == 0) {
       bnet_fsend(dir, OKqstatus, time);
       if ((last_jobs) && (last_jobs->size() > 0)) {
@@ -460,11 +460,11 @@ char *bac_status(char *buf, int buf_len)
       if (njcr->JobId != 0) {
          stat = JS_Running;
          termstat = _("Bacula Running");
-         free_jcr(njcr);
          break;
       }
-      free_jcr(njcr);
    }
+   endeach_jcr(njcr);
+
    if (stat != 0) {
       goto done;
    }
index 1907f633f983320a97f91d998a1446c0eaa05dd6..fde1868eca3329584649f9ab3f325b61957bf430 100644 (file)
@@ -9,7 +9,7 @@
  *   Version $Id$
  */
 /*
-   Copyright (C) 2000-2005 Kern Sibbald
+   Copyright (C) 2000-2006 Kern Sibbald
 
    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License
@@ -80,7 +80,9 @@
    jcr->JobStatus == JS_FatalError)
 
 #define foreach_jcr(jcr) \
-   for ((jcr)=NULL; ((jcr)=get_next_jcr(jcr)); )
+   for (jcr=jcr_walk_start(); jcr; (jcr=jcr_walk_next(jcr)) )
+
+#define endeach_jcr(jcr) jcr_walk_end(jcr)
 
 #define SD_APPEND 1
 #define SD_READ   0
index 0e2e40e0ffb61979a3a2cb11ba3e19ca80fd5662..d9809afdbf8038ee987618adb131c988e1a39e98 100644 (file)
@@ -133,12 +133,12 @@ depend:
        @$(MV) Makefile Makefile.bak
        @$(SED) "/^# DO NOT DELETE:/,$$ d" Makefile.bak > Makefile
        @$(ECHO) "# DO NOT DELETE: nice dependency list follows" >> Makefile
-       @$(CXX) -S -M $(CPPFLAGS) $(XINC) $(PYTHON_INC) -I$(srcdir) -I$(basedir) $(SQL_INC) *.c >> Makefile
+       @$(CXX) -S -M $(CPPFLAGS) $(XINC) $(PYTHON_INC) -I$(srcdir) -I$(basedir) $(SQL_INC) *.c >>Makefile
        @if test -f Makefile ; then \
            $(RMF) Makefile.bak; \
        else \
           $(MV) Makefile.bak Makefile; \
-          echo -e "Something went wrong\n\a"; \
+          echo " ===== Something went wrong in make depend ====="; \
        fi
 
 # -----------------------------------------------------------------------
index ae3318243798ef2dcbee4d9cc420bcc9fba5aa1f..d17f76d16da6d6088bea28c53d61f8ec7b0ff175 100644 (file)
@@ -7,22 +7,17 @@
  */
 
 /*
-   Copyright (C) 2000-2005 Kern Sibbald and John Walker
+   Copyright (C) 2000-2005 Kern Sibbald
 
    This program is free software; you can redistribute it and/or
-   modify it under the terms of the GNU General Public License as
-   published by the Free Software Foundation; either version 2 of
-   the License, or (at your option) any later version.
+   modify it under the terms of the GNU General Public License
+   version 2 as amended with additional clauses defined in the
+   file LICENSE in the main source directory.
 
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-   General Public License for more details.
-
-   You should have received a copy of the GNU General Public
-   License along with this program; if not, write to the Free
-   Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-   MA 02111-1307, USA.
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 
+   the file LICENSE for additional details.
 
  */
 
index d9cafe794e7d7747173f48454ee9f5e54b84c519..17e546bd6399aa5753717b2cd5ebc592f83ad670 100644 (file)
@@ -19,7 +19,7 @@
  * license please contact Landon Fuller <landonf@opendarwin.org>.
  */
 /*
-   Copyright (C) 2005 Kern Sibbald
+   Copyright (C) 2006 Kern Sibbald
 
    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License
@@ -97,8 +97,8 @@ typedef enum {
  * This must be kept in sync with the available message digest algorithms.
  * Just in case someone forgets, I've added assertions
  * to crypto_digest_finalize().
- *     MD5: 128 bits
- *     SHA-1: 160 bits
+ *      MD5: 128 bits
+ *      SHA-1: 160 bits
  */
 #ifndef HAVE_SHA2
 #define CRYPTO_DIGEST_MAX_SIZE CRYPTO_DIGEST_SHA1_SIZE
index 3db430beab155a199fe7e6aafe7b1e9723f6fb4d..cc1a24eaac985eec53439e72b63001e723e957c6 100755 (executable)
@@ -23,7 +23,7 @@
  *
  */
 /*
-   Copyright (C) 2000-2005 Kern Sibbald
+   Copyright (C) 2000-2006 Kern Sibbald
 
    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License
@@ -388,7 +388,7 @@ void b_free_jcr(const char *file, int line, JCR *jcr)
 void free_jcr(JCR *jcr)
 {
 
-   Dmsg1(3400, "Enter free_jcr 0x%x\n", jcr);
+   Dmsg2(3400, "Enter free_jcr 0x%x job=%d\n", jcr, jcr->JobId);
 
 #endif
 
@@ -402,7 +402,7 @@ void free_jcr(JCR *jcr)
    Dmsg3(3400, "Dec free_jcr 0x%x use_count=%d jobid=%d\n", jcr, jcr->use_count, jcr->JobId);
    if (jcr->use_count > 0) {          /* if in use */
       unlock_jcr_chain();
-      Dmsg2(3400, "free_jcr 0x%x use_count=%d\n", jcr, jcr->use_count);
+      Dmsg3(3400, "free_jcr 0x%x job=%d use_count=%d\n", jcr, jcr->JobId, jcr->use_count);
       return;
    }
 
@@ -574,7 +574,40 @@ static void unlock_jcr_chain()
 }
 
 
-JCR *get_next_jcr(JCR *prev_jcr)
+/*
+ * Start walk of jcr chain
+ * The proper way to walk the jcr chain is:
+ *    JCR *jcr;
+ *    foreach_jcr(jcr) {
+ *      ...
+ *    }
+ *    endeach_jcr(jcr);
+ *
+ *  It is possible to leave out the endeach_jcr(jcr), but
+ *   in that case, the last jcr referenced must be explicitly
+ *   released with:
+ *
+ *    free_jcr(jcr);
+ *  
+ */
+JCR *jcr_walk_start() 
+{
+   JCR *jcr;
+   lock_jcr_chain();
+   jcr = (JCR *)jcrs->first();
+   if (jcr) {
+      jcr->inc_use_count();
+      Dmsg3(3400, "Inc jcr_walk_start 0x%x job=%d use_count=%d\n", jcr, 
+            jcr->JobId, jcr->use_count);
+   }
+   unlock_jcr_chain();
+   return jcr;
+}
+
+/*
+ * Get next jcr from chain, and release current one
+ */
+JCR *jcr_walk_next(JCR *prev_jcr)
 {
    JCR *jcr;
 
@@ -582,12 +615,31 @@ JCR *get_next_jcr(JCR *prev_jcr)
    jcr = (JCR *)jcrs->next(prev_jcr);
    if (jcr) {
       jcr->inc_use_count();
-      Dmsg2(3400, "Inc get_next_jcr 0x%x use_count=%d\n", jcr, jcr->use_count);
+      Dmsg3(3400, "Inc jcr_walk_next 0x%x job=%d use_count=%d\n", jcr, 
+         jcr->JobId, jcr->use_count);
    }
    unlock_jcr_chain();
+   if (prev_jcr) {
+      free_jcr(prev_jcr);
+   }
    return jcr;
 }
 
+/*
+ * Release last jcr referenced
+ */
+void jcr_walk_end(JCR *jcr)
+{
+   if (jcr) {
+      free_jcr(jcr);
+   }
+}
+
+
+/*
+ * Setup to call the timeout check routine every 30 seconds
+ *  This routine will check any timers that have been enabled.
+ */
 bool init_jcr_subsystem(void)
 {
    watchdog_t *wd = new_watchdog();
@@ -615,7 +667,6 @@ static void jcr_timeout_check(watchdog_t *self)
     */
    foreach_jcr(jcr) {
       if (jcr->JobId == 0) {
-         free_jcr(jcr);
          continue;
       }
       fd = jcr->store_bsock;
@@ -623,7 +674,7 @@ static void jcr_timeout_check(watchdog_t *self)
          timer_start = fd->timer_start;
          if (timer_start && (watchdog_time - timer_start) > fd->timeout) {
             fd->timer_start = 0;      /* turn off timer */
-            fd->timed_out = TRUE;
+            fd->timed_out = true;
             Jmsg(jcr, M_ERROR, 0, _(
 "Watchdog sending kill after %d secs to thread stalled reading Storage daemon.\n"),
                  watchdog_time - timer_start);
@@ -635,7 +686,7 @@ static void jcr_timeout_check(watchdog_t *self)
          timer_start = fd->timer_start;
          if (timer_start && (watchdog_time - timer_start) > fd->timeout) {
             fd->timer_start = 0;      /* turn off timer */
-            fd->timed_out = TRUE;
+            fd->timed_out = true;
             Jmsg(jcr, M_ERROR, 0, _(
 "Watchdog sending kill after %d secs to thread stalled reading File daemon.\n"),
                  watchdog_time - timer_start);
@@ -647,15 +698,15 @@ static void jcr_timeout_check(watchdog_t *self)
          timer_start = fd->timer_start;
          if (timer_start && (watchdog_time - timer_start) > fd->timeout) {
             fd->timer_start = 0;      /* turn off timer */
-            fd->timed_out = TRUE;
+            fd->timed_out = true;
             Jmsg(jcr, M_ERROR, 0, _(
 "Watchdog sending kill after %d secs to thread stalled reading Director.\n"),
                  watchdog_time - timer_start);
             pthread_kill(jcr->my_thread_id, TIMEOUT_SIGNAL);
          }
       }
-      free_jcr(jcr);
    }
+   endeach_jcr(jcr);
 
    Dmsg0(3400, "Finished JCR timeout checks\n");
 }
index 5b5b6a82e14f24df72d2e09f123f677cb5354cbf..88c2fe4d16f1f7cb2784b897e5ab44c2e28ca3df 100644 (file)
@@ -9,22 +9,17 @@
  */
 
 /*
-   Copyright (C) 2000-2003 Kern Sibbald and John Walker
+   Copyright (C) 2000-2005 Kern Sibbald
 
    This program is free software; you can redistribute it and/or
-   modify it under the terms of the GNU General Public License as
-   published by the Free Software Foundation; either version 2 of
-   the License, or (at your option) any later version.
+   modify it under the terms of the GNU General Public License
+   version 2 as amended with additional clauses defined in the
+   file LICENSE in the main source directory.
 
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-   General Public License for more details.
-
-   You should have received a copy of the GNU General Public
-   License along with this program; if not, write to the Free
-   Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-   MA 02111-1307, USA.
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 
+   the file LICENSE for additional details.
 
  */
 
index 3d5601fe2877e40577ec4af6d7a1f503e169b1e7..3e8975cb7585f336406b0a14d6dce2aa3748a6e6 100644 (file)
@@ -167,6 +167,9 @@ void write_state_file(char *dir, const char *progname, int port);
 void job_end_push(JCR *jcr, void job_end_cb(JCR *jcr,void *), void *ctx);
 void lock_jobs();
 void unlock_jobs();
+JCR *jcr_walk_start();
+JCR *jcr_walk_next(JCR *prev_jcr);
+void jcr_walk_end(JCR *jcr);
 
 
 /* lex.c */
index cd91f7bed4c7ee160fcb8f0558a77617826fc825..90cf6044a0b67fe1f0122d91322422f326aaf4b6 100644 (file)
@@ -6,7 +6,7 @@
  *   Version $Id$
  */
 /*
-   Copyright (C) 2000-2005 Kern Sibbald
+   Copyright (C) 2000-2006 Kern Sibbald
 
    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License
index d230fedf7a86705e0fab2cb1bcac00e5d965e21b..6a2545bc4b4dddaf4c3110e73ae216477acb94c4 100644 (file)
@@ -7,22 +7,17 @@
  *
  */
 /*
-   Copyright (C) 2000-2004 Kern Sibbald and John Walker
+   Copyright (C) 2000-2006 Kern Sibbald
 
    This program is free software; you can redistribute it and/or
-   modify it under the terms of the GNU General Public License as
-   published by the Free Software Foundation; either version 2 of
-   the License, or (at your option) any later version.
+   modify it under the terms of the GNU General Public License
+   version 2 as amended with additional clauses defined in the
+   file LICENSE in the main source directory.
 
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-   General Public License for more details.
-
-   You should have received a copy of the GNU General Public
-   License along with this program; if not, write to the Free
-   Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-   MA 02111-1307, USA.
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 
+   the file LICENSE for additional details.
 
  */
 
@@ -30,7 +25,7 @@
 #ifndef __BLOCK_H
 #define __BLOCK_H 1
 
-#define MAX_BLOCK_LENGTH    500001      /* this is a sort of sanity check */
+#define MAX_BLOCK_LENGTH  (1024*1024 + 1) /* this is a sort of sanity check */
 #define DEFAULT_BLOCK_SIZE (512 * 126)  /* 64,512 N.B. do not use 65,636 here */
 
 /* Block Header definitions. */
index 99c0c720b90c627fe39641169a66d1a45fd0e83d..3ad2076e06ad5abe38c65f4e6af5b06af8d33bb2 100644 (file)
@@ -7,7 +7,7 @@
  *
  */
 /*
-   Copyright (C) 2003-2005 Kern Sibbald
+   Copyright (C) 2003-2006 Kern Sibbald
 
    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License
@@ -330,8 +330,9 @@ static void list_running_jobs(BSOCK *user)
          }
 #endif
       }
-      free_jcr(jcr);
    }
+   endeach_jcr(jcr);
+
    if (!found) {
       bnet_fsend(user, _("No Jobs running.\n"));
    }
@@ -499,8 +500,8 @@ bool qstatus_cmd(JCR *jcr)
          if (njcr->JobId != 0) {
             bnet_fsend(dir, DotStatusJob, njcr->JobId, njcr->JobStatus, njcr->JobErrors);
          }
-         free_jcr(njcr);
       }
+      endeach_jcr(njcr);
    } else if (strcmp(time.c_str(), "last") == 0) {
       bnet_fsend(dir, OKqstatus, time.c_str());
       if ((last_jobs) && (last_jobs->size() > 0)) {
index 05a053421fdc155716486c36b3bcdf00b29eede7..10513be5fcff918763eb6f82516b369108bfb992 100644 (file)
@@ -3,9 +3,9 @@
  */
 
 #undef  VERSION
-#define VERSION "1.39.3"
-#define BDATE   "17 December 2005"
-#define LSMDATE "17Dec05"
+#define VERSION "1.39.4"
+#define BDATE   "06 January 2006"
+#define LSMDATE "06Jan06"
 
 /* Debug flags */
 #undef  DEBUG