*/
bool is_bnet_stop(BSOCK * bsock)
{
- return bsock->errors || bsock->is_terminated();
+ return bsock->is_stop();
}
/*
*/
int is_bnet_error(BSOCK * bsock)
{
- errno = bsock->b_errno;
- return bsock->errors;
+ return bsock->is_error();
}
/*
if (stream == STREAM_UNIX_ATTRIBUTES || stream == STREAM_UNIX_ATTRIBUTES_EX ||
crypto_digest_stream_type(stream) != CRYPTO_DIGEST_NONE) {
if (!jcr->no_attributes) {
+ BSOCK *dir = jcr->dir_bsock;
if (are_attributes_spooled(jcr)) {
- jcr->dir_bsock->set_spooling();
+ dir->set_spooling();
}
Dmsg0(850, "Send attributes to dir.\n");
if (!dir_update_file_attributes(dcr, &rec)) {
- jcr->dir_bsock->clear_spooling();
+ dir->clear_spooling();
Jmsg(jcr, M_FATAL, 0, _("Error updating file attributes. ERR=%s\n"),
- jcr->dir_bsock->bstrerror());
+ dir->bstrerror());
ok = false;
break;
}
- jcr->dir_bsock->clear_spooling();
+ dir->clear_spooling();
}
}
Dmsg0(650, "Enter bnet_get\n");
}
Dmsg1(650, "End read loop with FD. Stat=%d\n", n);
- if (is_bnet_error(ds)) {
+ if (ds->is_error()) {
Dmsg1(350, "Network read error from FD. ERR=%s\n", ds->bstrerror());
Jmsg1(jcr, M_FATAL, 0, _("Network error on data channel. ERR=%s\n"),
ds->bstrerror());
jcr->Job, fd);
}
+/*
+ * Tell Director where to find the attributes spool file
+ * Note, if we are not on the same machine, the Director will
+ * return an error, and the higher level routine will transmit
+ * the data record by record -- using bsock->despool().
+ */
static bool blast_attr_spool_file(JCR *jcr, boffset_t size)
{
/* send full spool file name */
POOLMEM *name = get_pool_memory(PM_MESSAGE);
make_unique_spool_filename(jcr, &name, jcr->dir_bsock->m_fd);
bash_spaces(name);
- jcr->dir_bsock->fsend("BlastAttr Job=%s File=%s\n",
- jcr->Job, name);
+ jcr->dir_bsock->fsend("BlastAttr Job=%s File=%s\n", jcr->Job, name);
free_pool_memory(name);
if (jcr->dir_bsock->recv() <= 0) {
return false;
}
-bool open_attr_spool_file(JCR *jcr, BSOCK *bs)
+static bool open_attr_spool_file(JCR *jcr, BSOCK *bs)
{
POOLMEM *name = get_pool_memory(PM_MESSAGE);
return true;
}
-bool close_attr_spool_file(JCR *jcr, BSOCK *bs)
+static bool close_attr_spool_file(JCR *jcr, BSOCK *bs)
{
POOLMEM *name;