  }
 Index: src/jcr.h
 ===================================================================
---- src/jcr.h	(rvision 5856)
+--- src/jcr.h	(rvision 5882)
 +++ src/jcr.h	(copie de travail)
 @@ -301,6 +301,7 @@
     int32_t pki_session_encoded_size;  /* Size of DER-encoded pki_session */

 {
    int32_t n = 0;
    BSOCK *fd = jcr->file_bsock;
@@ -268,8 +267,13 @@
    uint64_t JobBytes = 0;
    int VSS = 0;
    int Encrypt = 0;
+   btimer_t *tid=NULL;
 
    set_jcr_job_status(jcr, JS_Running);
+
+   if (timeout) {
+      tid = start_bsock_timer(fd, timeout); /* TODO: use user timeout */
+   }
    /* Wait for Client to terminate */
    while ((n = bget_dirmsg(fd)) >= 0) {
       if (!fd_ok && 
@@ -288,6 +292,9 @@
          break;
       }
    }
+   if (tid) {
+      stop_bsock_timer(tid);
+   }
 
    if (is_bnet_error(fd)) {
       Jmsg(jcr, M_FATAL, 0, _("Network error with FD during %s: ERR=%s\n"),
Index: src/dird/protos.h
===================================================================
--- src/dird/protos.h	(rvision 5819)
+++ src/dird/protos.h	(copie de travail)
@@ -52,7 +52,7 @@
 extern bool find_recycled_volume(JCR *jcr, bool InChanger, MEDIA_DBR *mr);

Index: src/dird/backup.c
===================================================================
--- src/dird/backup.c	(rvision 5882)
+++ src/dird/backup.c	(copie de travail)
@@ -245,8 +245,7 @@
    set_jcr_job_status(jcr, JS_ErrorTerminated);
