diff options
author | Stefan Metzmacher <metze@samba.org> | 2005-09-27 16:53:08 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:39:04 -0500 |
commit | 0b2c6aec9217c40324dddcc2fef376f5a8c5c27d (patch) | |
tree | 8b223522c4d61b28ae1c9d1221c391ac82a3ee3a /source4/libcli/wrepl/winsrepl.h | |
parent | 5880f79f4f314b875d8cb2b72562f6cdf716ba67 (diff) | |
download | samba-0b2c6aec9217c40324dddcc2fef376f5a8c5c27d.tar.gz samba-0b2c6aec9217c40324dddcc2fef376f5a8c5c27d.tar.bz2 samba-0b2c6aec9217c40324dddcc2fef376f5a8c5c27d.zip |
r10547: - add wrepl_request timeout handling
- when we got an unexpected READ event, we need to do a socket_recv() to find connection errors
and we need to mark the socket as dead (and remove the fde_event) to prevent,
endless loops on broken connections
tridge: we should look carefull at other protocol, to handle broken connections without spinning
metze
(This used to be commit ff1272347739696dcdf2fd191b8f47ca82c205de)
Diffstat (limited to 'source4/libcli/wrepl/winsrepl.h')
-rw-r--r-- | source4/libcli/wrepl/winsrepl.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/source4/libcli/wrepl/winsrepl.h b/source4/libcli/wrepl/winsrepl.h index a966cf5451..64e09d61c6 100644 --- a/source4/libcli/wrepl/winsrepl.h +++ b/source4/libcli/wrepl/winsrepl.h @@ -39,6 +39,13 @@ struct wrepl_socket { /* the fd event */ struct fd_event *fde; + /* the default timeout for requests, 0 means no timeout */ +#define WREPL_SOCKET_REQUEST_TIMEOUT (60) + uint32_t request_timeout; + + /* counter for request timeouts, after 2 timeouts the socket is marked as dead */ + uint32_t timeout_count; + /* remember is the socket is dead */ BOOL dead; }; @@ -64,6 +71,8 @@ struct wrepl_request { size_t num_read; + struct timed_event *te; + struct wrepl_packet *packet; struct { |