From: Kern Sibbald Date: Sat, 8 Aug 2009 14:45:08 +0000 (+0200) Subject: Add data end tracking an attribute spooling X-Git-Tag: Release-5.0.0~333^2~56 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=200cf356307109c15971d7652070ad794e9f73ce;p=bacula%2Fbacula Add data end tracking an attribute spooling --- 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(); }