From 622bae394209a753f8c6f872a11cb11a4064c3fd Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Sat, 8 Aug 2009 16:45:08 +0200 Subject: [PATCH] Add data end tracking an attribute spooling --- bacula/src/lib/bsock.h | 2 ++ bacula/src/stored/askdir.c | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/bacula/src/lib/bsock.h b/bacula/src/lib/bsock.h index fca01157a4..996ce4973e 100644 --- a/bacula/src/lib/bsock.h +++ b/bacula/src/lib/bsock.h @@ -59,6 +59,7 @@ private: char *m_host; /* Host name/IP */ int m_port; /* desired port */ btimer_t *m_tid; /* timer id */ + boffset_t m_data_end; /* offset of last valid data written */ volatile bool m_timed_out: 1; /* timed out in read/write */ volatile bool m_terminated: 1; /* set when BNET_TERMINATE arrives */ bool m_duped: 1; /* set if duped BSOCK */ @@ -135,6 +136,7 @@ public: bool is_timed_out() { return m_timed_out; }; bool is_stop() { return errors || is_terminated(); } bool is_error() { errno = b_errno; return errors; } + void set_data_end() { if (m_spool) m_data_end = ftello(m_spool_fd); }; void set_spooling() { m_spool = true; }; void clear_spooling() { m_spool = false; }; void set_duped() { m_duped = true; }; diff --git a/bacula/src/stored/askdir.c b/bacula/src/stored/askdir.c index 37d33bdeff..b85d78e6eb 100644 --- a/bacula/src/stored/askdir.c +++ b/bacula/src/stored/askdir.c @@ -465,6 +465,10 @@ bool dir_update_file_attributes(DCR *dcr, DEV_RECORD *rec) ser_bytes(rec->data, rec->data_len); dir->msglen = ser_length(dir->msg); Dmsg1(1800, ">dird %s\n", dir->msg); /* Attributes */ + if (rec->Stream == STREAM_UNIX_ATTRIBUTES || + rec->Stream == STREAM_UNIX_ATTRIBUTES_EX) { + dir->set_data_end(); /* set offset of last valid data */ + } return dir->send(); } -- 2.39.5