From b1fea437bd581b435b8cc1fd12bd033754fda1e7 Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Sat, 20 Nov 2010 11:50:57 +0100 Subject: [PATCH] Remove spaces, try to stop FD faster on cancel --- bacula/src/filed/backup.c | 8 ++++---- bacula/src/filed/job.c | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/bacula/src/filed/backup.c b/bacula/src/filed/backup.c index 6e583ac563..a962fe267f 100644 --- a/bacula/src/filed/backup.c +++ b/bacula/src/filed/backup.c @@ -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; } diff --git a/bacula/src/filed/job.c b/bacula/src/filed/job.c index cab2be070c..e81f608342 100644 --- a/bacula/src/filed/job.c +++ b/bacula/src/filed/job.c @@ -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); } -- 2.39.5