aboutsummaryrefslogtreecommitdiffstats
path: root/dcc.h
diff options
context:
space:
mode:
authorulim <a.sporto+bee@gmail.com>2008-05-06 02:20:11 +0200
committerulim <a.sporto+bee@gmail.com>2008-05-06 02:20:11 +0200
commitd56ee38d444fb9a4bc0fbf7f699eaf675e019591 (patch)
treee01b72d9906e40d627c1dceb8d7956463cef8607 /dcc.h
parent29c1456dcadec0d239ffc9d88ea06695b66c435c (diff)
timeout of transfers after 120 seconds of no progress (bytes received/sent).
Diffstat (limited to 'dcc.h')
-rw-r--r--dcc.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/dcc.h b/dcc.h
index e53823e7..de24dac0 100644
--- a/dcc.h
+++ b/dcc.h
@@ -46,6 +46,10 @@
/* Send an ACK after receiving this amount of data */
#define DCC_PACKET_SIZE 1024
+/* Time in seconds that a DCC transfer can be stalled before being aborted.
+ * By handling this here individual protocols don't have to think about this. */
+#define DCC_MAX_STALL 120
+
typedef struct dcc_file_transfer {
struct im_connection *ic;
@@ -63,6 +67,10 @@ typedef struct dcc_file_transfer {
gint watch_in; /* readable */
gint watch_out; /* writable */
+ /* the progress watcher cancels any file transfer if nothing happens within DCC_MAX_STALL */
+ gint progress_timeout;
+ size_t progress_bytes_last;
+
/*
* The total amount of bytes that have been sent to the irc client.
*/