+/*
+ Bacula® - The Network Backup Solution
+
+ Copyright (C) 2004-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.
+ This program is Free Software; you can redistribute it and/or
+ modify it under the terms of version two of the GNU General Public
+ License as published by the Free Software Foundation plus additions
+ that are listed in the file LICENSE.
+
+ 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., 51 Franklin Street, Fifth Floor, Boston, MA
+ 02110-1301, USA.
+
+ Bacula® is a registered trademark of John Walker.
+ The licensor of Bacula is the Free Software Foundation Europe
+ (FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich,
+ Switzerland, email:ftf@fsfeurope.org.
+*/
/*
* Spooling code
*
*
* Version $Id$
*/
-/*
- 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
- 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
- the file LICENSE for additional details.
-
- */
#include "bacula.h"
#include "stored.h"
void list_spool_stats(void sendit(const char *msg, int len, void *sarg), void *arg)
{
- char *msg, ed1[30], ed2[30];
+ char ed1[30], ed2[30];
+ POOL_MEM msg(PM_MESSAGE);
int len;
- msg = (char *)get_pool_memory(PM_MESSAGE);
-
if (spool_stats.data_jobs || spool_stats.max_data_size) {
len = Mmsg(msg, _("Data spooling: %u active jobs, %s bytes; %u total jobs, %s max bytes/job.\n"),
spool_stats.data_jobs, edit_uint64_with_commas(spool_stats.data_size, ed1),
spool_stats.total_data_jobs,
edit_uint64_with_commas(spool_stats.max_data_size, ed2));
- sendit(msg, len, arg);
+ sendit(msg.c_str(), len, arg);
}
if (spool_stats.attr_jobs || spool_stats.max_attr_size) {
len = Mmsg(msg, _("Attr spooling: %u active jobs, %s bytes; %u total jobs, %s max bytes.\n"),
spool_stats.total_attr_jobs,
edit_uint64_with_commas(spool_stats.max_attr_size, ed2));
- sendit(msg, len, arg);
+ sendit(msg.c_str(), len, arg);
}
-
- free_pool_memory(msg);
}
bool begin_data_spool(DCR *dcr)
} else {
dir = working_directory;
}
- Mmsg(name, "%s/%s.data.%s.%s.spool", dir, my_name, dcr->jcr->Job,
- dcr->device->hdr.name);
+ Mmsg(name, "%s/%s.data.%u.%s.%s.spool", dir, my_name, dcr->jcr->JobId,
+ dcr->jcr->Job, dcr->device->hdr.name);
}
free_pool_memory(rdev->errmsg);
/* Be careful to NULL the jcr and free rdev after free_dcr() */
rdcr->jcr = NULL;
+ rdcr->dev = NULL;
free_dcr(rdcr);
free(rdev);
dcr->spooling = true; /* turn on spooling again */
V(mutex);
Jmsg(jcr, M_INFO, 0, _("Sending spooled attrs to the Director. Despooling %s bytes ...\n"),
edit_uint64_with_commas(size, ec1));
- bnet_despool_to_bsock(jcr->dir_bsock, update_attr_spool_size, size);
+ jcr->dir_bsock->despool(update_attr_spool_size, size);
return close_attr_spool_file(jcr, jcr->dir_bsock);
}
return true;