]> git.sur5r.net Git - bacula/bacula/commitdiff
Remove spaces, try to stop FD faster on cancel
authorKern Sibbald <kern@sibbald.com>
Sat, 20 Nov 2010 10:50:57 +0000 (11:50 +0100)
committerEric Bollengier <eric@eb.homelinux.org>
Thu, 25 Nov 2010 13:55:51 +0000 (14:55 +0100)
bacula/src/filed/backup.c
bacula/src/filed/job.c

index 6e583ac563196781889633780796777d7321f338..a962fe267f58cfa5e94ebc79135b3f499c6f16bd 100644 (file)
@@ -750,7 +750,7 @@ int save_file(JCR *jcr, FF_PKT *ff_pkt, bool top_level)
    }
 
 good_rtn:
-   rtnstat = 1;                       /* good return */
+   rtnstat = jcr->is_job_canceled() ? 0 : 1; /* good return if not canceled */
 
 bail_out:
    if (ff_pkt->cmd_plugin && plugin_started) {
@@ -1220,7 +1220,7 @@ bool encode_and_send_attributes(JCR *jcr, FF_PKT *ff_pkt, int &data_stream)
          }
          Dmsg2(100, "Object compressed from %d to %d bytes\n", ff_pkt->object_len, comp_len);
       }
-      sd->msglen = Mmsg(sd->msg, "%d %d %d %d %d %d %s%c%s%c", 
+      sd->msglen = Mmsg(sd->msg, "%d %d %d %d %d %d %s%c%s%c",
                         jcr->JobFiles, ff_pkt->type, ff_pkt->object_index,
                         comp_len, ff_pkt->object_len, ff_pkt->object_compression,
                         ff_pkt->fname, 0, ff_pkt->object_name, 0);
@@ -1235,12 +1235,12 @@ bool encode_and_send_attributes(JCR *jcr, FF_PKT *ff_pkt, int &data_stream)
       break;
    case FT_REG:
       stat = sd->fsend("%ld %d %s%c%s%c%c%s%c%d%c", jcr->JobFiles,
-               ff_pkt->type, ff_pkt->fname, 0, attribs, 0, 0, attribsEx, 0, 
+               ff_pkt->type, ff_pkt->fname, 0, attribs, 0, 0, attribsEx, 0,
                ff_pkt->delta_seq, 0);
       break;
    default:
       stat = sd->fsend("%ld %d %s%c%s%c%c%s%c%u%c", jcr->JobFiles,
-                       ff_pkt->type, ff_pkt->fname, 0, attribs, 0, 0, 
+                       ff_pkt->type, ff_pkt->fname, 0, attribs, 0, 0,
                        attribsEx, 0, ff_pkt->delta_seq, 0);
       break;
    }
index cab2be070c5289586bc76ef24653ab56c1cfc369..e81f608342c3203ca1079fa4f0d21b4e3cdb9e32 100644 (file)
@@ -452,13 +452,13 @@ static int cancel_cmd(JCR *jcr)
       if (!(cjcr=get_jcr_by_full_name(Job))) {
          dir->fsend(_("2901 Job %s not found.\n"), Job);
       } else {
+         generate_plugin_event(cjcr, bEventCancelCommand, NULL);
+         set_jcr_job_status(cjcr, JS_Canceled);
          if (cjcr->store_bsock) {
             cjcr->store_bsock->set_timed_out();
             cjcr->store_bsock->set_terminated();
             cjcr->my_thread_send_signal(TIMEOUT_SIGNAL);
          }
-         generate_plugin_event(cjcr, bEventCancelCommand, NULL);
-         set_jcr_job_status(cjcr, JS_Canceled);
          free_jcr(cjcr);
          dir->fsend(_("2001 Job %s marked to be canceled.\n"), Job);
       }