From: Kern Sibbald Date: Wed, 8 Aug 2007 13:20:28 +0000 (+0000) Subject: Modify most of dird/msgchan.c to use bsock class calls rather than X-Git-Tag: Release-7.0.0~5882 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=0e0a5d70633fd06353405b8ae4eb63c27dd74d0c;p=bacula%2Fbacula Modify most of dird/msgchan.c to use bsock class calls rather than bnet calls -- no functionality change. git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@5304 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/bacula/kernstodo b/bacula/kernstodo index 3fe82faffa..b184f05c53 100644 --- a/bacula/kernstodo +++ b/bacula/kernstodo @@ -58,6 +58,7 @@ Professional Needs: http://www.microsoft.com/technet/itshowcase/content/exchbkup.mspx Priority: +- Implement SDErrors (must return from SD) - Implement USB keyboard support in rescue CD. - Remove all install temp files in Win32 PLUGINSDIR. - Audit retention periods to make sure everything is 64 bit. diff --git a/bacula/src/dird/msgchan.c b/bacula/src/dird/msgchan.c index bdf82f7bd3..935a9d08ab 100644 --- a/bacula/src/dird/msgchan.c +++ b/bacula/src/dird/msgchan.c @@ -1,7 +1,7 @@ /* Bacula® - The Network Backup Solution - Copyright (C) 2000-20076 Free Software Foundation Europe e.V. + Copyright (C) 2000-2007 Free Software Foundation Europe e.V. The main author of Bacula is Kern Sibbald, with contributions from many others, a complete list can be found in the file AUTHORS. @@ -112,7 +112,7 @@ bool connect_to_storage_daemon(JCR *jcr, int retry_interval, jcr->store_bsock = sd; if (!authenticate_storage_daemon(jcr, store)) { - bnet_close(sd); + sd->close(); jcr->store_bsock = NULL; return false; } @@ -134,7 +134,7 @@ bool update_device_res(JCR *jcr, DEVICE *dev) sd = jcr->store_bsock; pm_strcpy(device_name, dev->name()); bash_spaces(device_name); - bnet_fsend(sd, query_device, device_name.c_str()); + sd->fsend(query_device, device_name.c_str()); Dmsg1(100, ">stored: %s\n", sd->msg); /* The data is returned through Device_update */ if (bget_dirmsg(sd) <= 0) { @@ -178,16 +178,16 @@ bool start_storage_daemon_job(JCR *jcr, alist *rstore, alist *wstore) * for the same jobid. */ if (jcr->reschedule_count) { - bnet_fsend(sd, "cancel Job=%s\n", jcr->Job); - while (bnet_recv(sd) >= 0) + sd->fsend("cancel Job=%s\n", jcr->Job); + while (sd->recv() >= 0) { } } - bnet_fsend(sd, jobcmd, edit_int64(jcr->JobId, ed1), jcr->Job, - job_name.c_str(), client_name.c_str(), - jcr->JobType, jcr->JobLevel, - fileset_name.c_str(), !jcr->pool->catalog_files, - jcr->job->SpoolAttributes, jcr->fileset->MD5, jcr->spool_data, - jcr->write_part_after_job, jcr->job->PreferMountedVolumes); + sd->fsend(jobcmd, edit_int64(jcr->JobId, ed1), jcr->Job, + job_name.c_str(), client_name.c_str(), + jcr->JobType, jcr->JobLevel, + fileset_name.c_str(), !jcr->pool->catalog_files, + jcr->job->SpoolAttributes, jcr->fileset->MD5, jcr->spool_data, + jcr->write_part_after_job, jcr->job->PreferMountedVolumes); Dmsg1(100, ">stored: %s\n", sd->msg); if (bget_dirmsg(sd) > 0) { Dmsg1(100, "msg); @@ -202,7 +202,7 @@ bool start_storage_daemon_job(JCR *jcr, alist *rstore, alist *wstore) } } else { Jmsg(jcr, M_FATAL, 0, _("bstrerror()); return 0; } @@ -232,20 +232,20 @@ bool start_storage_daemon_job(JCR *jcr, alist *rstore, alist *wstore) bash_spaces(store_name); pm_strcpy(media_type, storage->media_type); bash_spaces(media_type); - bnet_fsend(sd, use_storage, store_name.c_str(), media_type.c_str(), - pool_name.c_str(), pool_type.c_str(), 0, copy, stripe); + sd->fsend(use_storage, store_name.c_str(), media_type.c_str(), + pool_name.c_str(), pool_type.c_str(), 0, copy, stripe); Dmsg1(100, "rstore >stored: %s", sd->msg); DEVICE *dev; /* Loop over alternative storage Devices until one is OK */ foreach_alist(dev, storage->device) { pm_strcpy(device_name, dev->name()); bash_spaces(device_name); - bnet_fsend(sd, use_device, device_name.c_str()); + sd->fsend(use_device, device_name.c_str()); Dmsg1(100, ">stored: %s", sd->msg); } - bnet_sig(sd, BNET_EOD); /* end of Devices */ + sd->signal(BNET_EOD); /* end of Devices */ } - bnet_sig(sd, BNET_EOD); /* end of Storages */ + sd->signal(BNET_EOD); /* end of Storages */ if (bget_dirmsg(sd) > 0) { Dmsg1(100, "msg); /* ****FIXME**** save actual device name */ @@ -266,8 +266,8 @@ bool start_storage_daemon_job(JCR *jcr, alist *rstore, alist *wstore) bash_spaces(store_name); pm_strcpy(media_type, storage->media_type); bash_spaces(media_type); - bnet_fsend(sd, use_storage, store_name.c_str(), media_type.c_str(), - pool_name.c_str(), pool_type.c_str(), 1, copy, stripe); + sd->fsend(use_storage, store_name.c_str(), media_type.c_str(), + pool_name.c_str(), pool_type.c_str(), 1, copy, stripe); Dmsg1(100, "wstore >stored: %s", sd->msg); DEVICE *dev; @@ -275,12 +275,12 @@ bool start_storage_daemon_job(JCR *jcr, alist *rstore, alist *wstore) foreach_alist(dev, storage->device) { pm_strcpy(device_name, dev->name()); bash_spaces(device_name); - bnet_fsend(sd, use_device, device_name.c_str()); + sd->fsend(use_device, device_name.c_str()); Dmsg1(100, ">stored: %s", sd->msg); } - bnet_sig(sd, BNET_EOD); /* end of Devices */ + sd->signal(BNET_EOD); /* end of Devices */ } - bnet_sig(sd, BNET_EOD); /* end of Storages */ + sd->signal(BNET_EOD); /* end of Storages */ if (bget_dirmsg(sd) > 0) { Dmsg1(100, "msg); /* ****FIXME**** save actual device name */ diff --git a/bacula/src/version.h b/bacula/src/version.h index 684687652f..0d914ba896 100644 --- a/bacula/src/version.h +++ b/bacula/src/version.h @@ -4,8 +4,8 @@ #undef VERSION #define VERSION "2.1.29" -#define BDATE "06 August 2007" -#define LSMDATE "06Aug07" +#define BDATE "08 August 2007" +#define LSMDATE "08Aug07" #define PROG_COPYRIGHT "Copyright (C) %d-2007 Free Software Foundation Europe e.V.\n" #define BYEAR "2007" /* year for copyright messages in progs */ diff --git a/bacula/technotes-2.1 b/bacula/technotes-2.1 index b43d5e6560..9198c91d84 100644 --- a/bacula/technotes-2.1 +++ b/bacula/technotes-2.1 @@ -1,6 +1,9 @@ Technical notes on version 2.1 General: +08Aug07 +kes Modify most of dird/msgchan.c to use bsock class calls rather than + bnet calls -- no functionality change. 07Aug07 kes Modify the Verify output to specify if files are missing on the Volume(s) or disk. Fixes confusion in bug #916.