From 2dcdb41af59bf362a2aa2aba0c674ec35f8e8d83 Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Wed, 26 Sep 2007 14:49:50 +0000 Subject: [PATCH] Update git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@5655 91ce42f0-d328-0410-95d8-f526ca767f89 --- bacula/src/dird/backup.c | 10 +++++----- bacula/src/dird/fd_cmds.c | 20 ++++++++++---------- bacula/src/dird/verify.c | 2 +- bacula/src/filed/job.c | 4 ++-- bacula/src/lib/btimers.c | 3 ++- 5 files changed, 20 insertions(+), 19 deletions(-) diff --git a/bacula/src/dird/backup.c b/bacula/src/dird/backup.c index ba1bdfe00d..8c7a3cef46 100644 --- a/bacula/src/dird/backup.c +++ b/bacula/src/dird/backup.c @@ -200,7 +200,7 @@ bool do_backup(JCR *jcr) } } - bnet_fsend(fd, storaddr, store->address, store->SDDport, tls_need); + fd->fsend(storaddr, store->address, store->SDDport, tls_need); if (!response(jcr, fd, OKstore, "Storage", DISPLAY_ERROR)) { goto bail_out; } @@ -226,7 +226,7 @@ bool do_backup(JCR *jcr) } /* Send backup command */ - bnet_fsend(fd, backupcmd); + fd->fsend(backupcmd); if (!response(jcr, fd, OKbackup, "backup", DISPLAY_ERROR)) { goto bail_out; } @@ -293,7 +293,7 @@ int wait_for_job_termination(JCR *jcr) Jmsg(jcr, M_FATAL, 0, _("Network error with FD during %s: ERR=%s\n"), job_type_to_str(jcr->JobType), fd->bstrerror()); } - bnet_sig(fd, BNET_TERMINATE); /* tell Client we are terminating */ + fd->signal(BNET_TERMINATE); /* tell Client we are terminating */ /* Force cancel in SD if failing */ if (job_canceled(jcr) || !fd_ok) { @@ -388,7 +388,7 @@ void backup_cleanup(JCR *jcr, int TermCode) term_msg = _("*** Backup Error ***"); msg_type = M_ERROR; /* Generate error message */ if (jcr->store_bsock) { - bnet_sig(jcr->store_bsock, BNET_TERMINATE); + jcr->store_bsock->signal(BNET_TERMINATE); if (jcr->SD_msg_chan) { pthread_cancel(jcr->SD_msg_chan); } @@ -397,7 +397,7 @@ void backup_cleanup(JCR *jcr, int TermCode) case JS_Canceled: term_msg = _("Backup Canceled"); if (jcr->store_bsock) { - bnet_sig(jcr->store_bsock, BNET_TERMINATE); + jcr->store_bsock->signal(BNET_TERMINATE); if (jcr->SD_msg_chan) { pthread_cancel(jcr->SD_msg_chan); } diff --git a/bacula/src/dird/fd_cmds.c b/bacula/src/dird/fd_cmds.c index 36824c0dda..7272325f8d 100644 --- a/bacula/src/dird/fd_cmds.c +++ b/bacula/src/dird/fd_cmds.c @@ -442,7 +442,7 @@ bool send_include_list(JCR *jcr) { BSOCK *fd = jcr->file_bsock; if (jcr->fileset->new_include) { - bnet_fsend(fd, filesetcmd, jcr->fileset->enable_vss ? " vss=1" : ""); + fd->fsend(filesetcmd, jcr->fileset->enable_vss ? " vss=1" : ""); return send_fileset(jcr); } return true; @@ -484,11 +484,11 @@ bool send_bootstrap_file(JCR *jcr, BSOCK *sock) set_jcr_job_status(jcr, JS_ErrorTerminated); return false; } - bnet_fsend(sock, bootstrap); + sock->fsend(bootstrap); while (fgets(buf, sizeof(buf), bs)) { - bnet_fsend(sock, "%s", buf); + sock->fsend("%s", buf); } - bnet_sig(sock, BNET_EOD); + sock->signal(BNET_EOD); fclose(bs); if (jcr->unlink_bsr) { unlink(jcr->RestoreBootstrap); @@ -550,11 +550,11 @@ int send_runscripts_commands(JCR *jcr) result = send_runscript_with_old_proto(jcr, cmd->when, msg); } else { - bnet_fsend(fd, runscript, cmd->on_success, - cmd->on_failure, - cmd->fail_on_error, - cmd->when, - msg); + fd->fsend(runscript, cmd->on_success, + cmd->on_failure, + cmd->fail_on_error, + cmd->when, + msg); result = response(jcr, fd, OKRunScript, "RunScript", DISPLAY_ERROR); launch_before_cmd = true; @@ -575,7 +575,7 @@ int send_runscripts_commands(JCR *jcr) /* Tell the FD to execute the ClientRunBeforeJob */ if (launch_before_cmd) { - bnet_fsend(fd, runbeforenow); + fd->fsend(runbeforenow); if (!response(jcr, fd, OKRunBeforeNow, "RunBeforeNow", DISPLAY_ERROR)) { goto bail_out; } diff --git a/bacula/src/dird/verify.c b/bacula/src/dird/verify.c index 0981b104b7..8562add9db 100644 --- a/bacula/src/dird/verify.c +++ b/bacula/src/dird/verify.c @@ -193,7 +193,7 @@ bool do_verify(JCR *jcr) if (!start_storage_daemon_job(jcr, jcr->rstorage, NULL)) { return false; } - if (!bnet_fsend(jcr->store_bsock, "run")) { + if (!jcr->store_bsock->fsend("run")) { return false; } /* diff --git a/bacula/src/filed/job.c b/bacula/src/filed/job.c index 561297044b..d2f5097102 100644 --- a/bacula/src/filed/job.c +++ b/bacula/src/filed/job.c @@ -1316,7 +1316,7 @@ static int storage_cmd(JCR *jcr) jcr->store_bsock = sd; - bnet_fsend(sd, "Hello Start Job %s\n", jcr->Job); + sd->fsend("Hello Start Job %s\n", jcr->Job); if (!authenticate_storagedaemon(jcr)) { Jmsg(jcr, M_FATAL, 0, _("Failed to authenticate Storage daemon.\n")); return 0; @@ -1324,7 +1324,7 @@ static int storage_cmd(JCR *jcr) Dmsg0(110, "Authenticated with SD.\n"); /* Send OK to Director */ - return bnet_fsend(dir, OKstore); + return dir->fsend(OKstore); } diff --git a/bacula/src/lib/btimers.c b/bacula/src/lib/btimers.c index 4c44922f38..28aba10bfd 100644 --- a/bacula/src/lib/btimers.c +++ b/bacula/src/lib/btimers.c @@ -231,8 +231,9 @@ static void callback_thread_timer(watchdog_t *self) if (wid->type == TYPE_BSOCK && wid->bsock) { wid->bsock->set_timed_out(); } + Jmsg(wid->jcr, M_INFO, 0, _("Thread timer expired. Thread for JobId=%u interrupted.\n"), + get_jobid_from_tid(wid->tid)); pthread_kill(wid->tid, TIMEOUT_SIGNAL); - Jmsg(wid->jcr, M_INFO, 0, _("Thread timer expired. Thread interrupted.\n")); } static btimer_t *btimer_start_common(uint32_t wait) -- 2.39.5