added timeout option in rsyncd.conf
authorAndrew Tridgell <tridge@samba.org>
Wed, 4 Nov 1998 03:14:22 +0000 (03:14 +0000)
committerAndrew Tridgell <tridge@samba.org>
Wed, 4 Nov 1998 03:14:22 +0000 (03:14 +0000)
clientserver.c
loadparm.c
rsyncd.conf.yo

index 4b8ed53b27c28bbd5b19dedfe93d49f4f13ee1d0..809d16bc80d353049d290fbff0d769b2ea6878d5 100644 (file)
@@ -314,6 +314,11 @@ static int rsync_module(int fd, int i)
                exit_cleanup(RERR_SYNTAX);
        }
 
+       if (lp_timeout(i)) {
+               extern int io_timeout;
+               io_timeout = lp_timeout(i);
+       }
+
        start_server(fd, fd, argc, argp);
 
        return 0;
index 6814d13ab79ff6ebd8ffb4487a30d6755a10cb16..81c4943a7e7fc8f5e145e92dfb381aeec66a19fe 100644 (file)
@@ -130,6 +130,7 @@ typedef struct
        char *exclude;
        char *exclude_from;
        char *log_format;
+       int timeout;
 } service;
 
 
@@ -152,6 +153,7 @@ static service sDefault =
        NULL,    /* exclude */
        NULL,    /* exclude from */
        "%o %h [%a] %m (%u) %f %l",    /* log format */
+       0        /* timeout */
 };
 
 
@@ -242,6 +244,7 @@ static struct parm_struct parm_table[] =
   {"log file",         P_STRING,  P_GLOBAL, &Globals.log_file,      NULL,  0},
   {"pid file",         P_STRING,  P_GLOBAL, &Globals.pid_file,      NULL,  0},
 
+  {"timeout",          P_INTEGER, P_LOCAL,  &sDefault.timeout,     NULL,  0},
   {"name",             P_STRING,  P_LOCAL,  &sDefault.name,        NULL,   0},
   {"comment",          P_STRING,  P_LOCAL,  &sDefault.comment,     NULL,   0},
   {"path",             P_STRING,  P_LOCAL,  &sDefault.path,        NULL,   0},
@@ -330,6 +333,7 @@ FN_LOCAL_STRING(lp_secrets_file, secrets_file)
 FN_LOCAL_STRING(lp_exclude, exclude)
 FN_LOCAL_STRING(lp_exclude_from, exclude_from)
 FN_LOCAL_STRING(lp_log_format, log_format)
+FN_LOCAL_INTEGER(lp_timeout, timeout)
 
 /* local prototypes */
 static int    strwicmp( char *psz1, char *psz2 );
index faa31c5a32289364871a0b6fa5a82be4b06e1f82..ac0e7dea4a664b451ef64a7601e8f97cac132ded 100644 (file)
@@ -107,39 +107,6 @@ ftp, kern, lpr, mail, news, security, syslog, user, uucp, local0,
 local1, local2, local3, local4, local5, local6 and local7. The default
 is daemon. 
 
-dit(bf(transfer logging)) The "transfer logging" option enables per-file 
-logging of downloads and uploads in a format somewhat similar to that
-used by ftp daemons. If you want to customise the log formats look at
-log_send, log_recv and log_transfer in log.c
-
-dit(bf(log format)) The "log format" option allows you to specify the
-format used for logging file transfers when transfer logging is
-enabled. The format is a text string containing embedded single
-character escape sequences prefixed with a percent (%) character.
-
-The prefixes that are understood are:
-
-itemize(
-  it() %h for the remote host name
-  it() %a for the remote IP address
-  it() %l for the length of the file in bytes
-  it() %p for the process id of this rsync session
-  it() %o for the operation, which is either "send" or "recv"
-  it() %f for the filename
-  it() %P for the module path
-  it() %m for the module name
-  it() %t for the current time
-  it() %u for the authenticated username (or the null string)
-  it() %b for the number of bytes actually transferred 
-  it() %c when sending files this gives the number of checksum bytes
-    received for this file
-)
-
-The default log format is "%o %h [%a] %m (%u) %f %l"
-
-A perl script called rsyncstats to summarise this format is included
-in the rsync source code distribution.
-
 dit(bf(socket options)) This option can provide endless fun for people
 who like to tune their systems to the utmost degree. You can set all
 sorts of socket options which may make transfers faster (or
@@ -279,6 +246,46 @@ rejected. See the "hosts allow" option for more information.
 
 The default is no "hosts deny" option, which means all hosts can connect.
 
+dit(bf(transfer logging)) The "transfer logging" option enables per-file 
+logging of downloads and uploads in a format somewhat similar to that
+used by ftp daemons. If you want to customise the log formats look at
+the log format option.
+
+dit(bf(log format)) The "log format" option allows you to specify the
+format used for logging file transfers when transfer logging is
+enabled. The format is a text string containing embedded single
+character escape sequences prefixed with a percent (%) character.
+
+The prefixes that are understood are:
+
+itemize(
+  it() %h for the remote host name
+  it() %a for the remote IP address
+  it() %l for the length of the file in bytes
+  it() %p for the process id of this rsync session
+  it() %o for the operation, which is either "send" or "recv"
+  it() %f for the filename
+  it() %P for the module path
+  it() %m for the module name
+  it() %t for the current time
+  it() %u for the authenticated username (or the null string)
+  it() %b for the number of bytes actually transferred 
+  it() %c when sending files this gives the number of checksum bytes
+    received for this file
+)
+
+The default log format is "%o %h [%a] %m (%u) %f %l"
+
+A perl script called rsyncstats to summarise this format is included
+in the rsync source code distribution.
+
+dit(bf(timeout)) The "timeout" option allows you to override the
+clients choice for IO timoeut for this module. Using this option you
+can ensure that rsync won't wait on a dead client forever. The timeout
+is specified in seconds. A value of zero means no timeout and is the
+default. A good choice for anonymous rsync servers may be 600 (giving
+a 10 minute timeout).
+
 enddit()
 
 manpagesection(AUTHENTICATION STRENGTH)