]> arthur.barton.de Git - netatalk.git/blobdiff - etc/afpd/afp_options.c
MFH:
[netatalk.git] / etc / afpd / afp_options.c
index 5da26aae8bd8f95d253e1a3af93deb73b9607e24..69e44ddf2da148c8596a40a7afb8903744f1af30 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: afp_options.c,v 1.13.2.1 2001-12-03 05:01:03 jmarcus Exp $
+ * $Id: afp_options.c,v 1.13.2.6 2002-02-11 17:46:40 jmarcus Exp $
  *
  * Copyright (c) 1997 Adrian Sun (asun@zoology.washington.edu)
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
@@ -141,6 +141,8 @@ void afp_options_init(struct afp_options *options)
     options->transports = AFPTRANS_ALL;
     options->passwdfile = _PATH_AFPDPWFILE;
     options->tickleval = 30;
+    options->timeout = 4;
+    options->server_notif = 1;
     options->authprintdir = NULL;
     options->umask = 0;
 #ifdef ADMIN_GRP
@@ -206,6 +208,8 @@ int afp_options_parseline(char *buf, struct afp_options *options)
         options->transports |= AFPTRANS_DDP;
     if (strstr(buf, " -noddp"))
         options->transports &= ~AFPTRANS_DDP;
+    if (strstr(buf, "-client_polling"))
+        options->server_notif = 0;
 
     /* figure out options w/ values. currently, this will ignore the setting
      * if memory is lacking. */
@@ -223,8 +227,18 @@ int afp_options_parseline(char *buf, struct afp_options *options)
         options->passwdminlen = MIN(1, atoi(c));
     if ((c = getoption(buf, "-loginmaxfail")))
         options->loginmaxfail = atoi(c);
-    if ((c = getoption(buf, "-tickleval")))
+    if ((c = getoption(buf, "-tickleval"))) {
         options->tickleval = atoi(c);
+        if (options->tickleval <= 0) {
+            options->tickleval = 30;
+        }
+    }
+    if ((c = getoption(buf, "-timeout"))) {
+        options->timeout = atoi(c);
+        if (options->timeout <= 0) {
+            options->timeout = 4;
+        }
+    }
 
     if ((c = getoption(buf, "-server_quantum")))
         options->server_quantum = strtoul(c, NULL, 0);