/*
Bacula® - The Network Backup Solution
- Copyright (C) 2000-2007 Free Software Foundation Europe e.V.
+ Copyright (C) 2000-2008 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.
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.
- Bacula® is a registered trademark of John Walker.
+ Bacula® is a registered trademark of Kern Sibbald.
The licensor of Bacula is the Free Software Foundation Europe
(FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich,
Switzerland, email:ftf@fsfeurope.org.
private:
BSOCK *m_next; /* next BSOCK if duped */
JCR *m_jcr; /* jcr or NULL for error msgs */
+ pthread_mutex_t m_mutex; /* for locking if use_locking set */
char *m_who; /* Name of daemon to which we are talking */
char *m_host; /* Host name/IP */
int m_port; /* desired port */
volatile bool m_terminated: 1; /* set when BNET_TERMINATE arrives */
bool m_duped: 1; /* set if duped BSOCK */
bool m_spool: 1; /* set for spooling */
+ bool m_use_locking: 1; /* set to use locking */
void fin_init(JCR * jcr, int sockfd, const char *who, const char *host, int port,
struct sockaddr *lclient_addr);
int set_nonblocking();
int set_blocking();
void restore_blocking(int flags);
- int wait_data(int sec);
- int wait_data_intr(int sec);
+ int wait_data(int sec, int usec=0);
+ int wait_data_intr(int sec, int usec=0);
bool authenticate_director(const char *name, const char *password,
TLS_CONTEXT *tls_ctx, char *msg, int msglen);
+ bool set_locking(); /* in bsock.c */
+ void clear_locking(); /* in bsock.c */
/* Inline functions */
void set_jcr(JCR *jcr) { m_jcr = jcr; };