X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=etc%2Fafpd%2Fafp_options.c;h=16863eb547ae3c12b7ea635562aff80074511d87;hb=b0bcb8f6b0571592a50ce039882c9319e012a270;hp=c966e464e8ccd2fbe0a716f619e3c76da9e6295d;hpb=a2a14b017e89224e9c0b6ff94f2b781244d32a7a;p=netatalk.git diff --git a/etc/afpd/afp_options.c b/etc/afpd/afp_options.c index c966e464..16863eb5 100644 --- a/etc/afpd/afp_options.c +++ b/etc/afpd/afp_options.c @@ -34,8 +34,9 @@ #include #include #include +#include +#include -#include "globals.h" #include "status.h" #include "auth.h" #include "dircache.h" @@ -139,6 +140,8 @@ void afp_options_free(struct afp_options *opt, free(opt->ntseparator); if (opt->logconfig && (opt->logconfig != save->logconfig)) free(opt->logconfig); + if (opt->mimicmodel && (opt->mimicmodel != save->mimicmodel)) + free(opt->mimicmodel); } /* initialize options */ @@ -159,8 +162,9 @@ void afp_options_init(struct afp_options *options) options->transports = AFPTRANS_TCP; /* TCP only */ options->passwdfile = _PATH_AFPDPWFILE; options->tickleval = 30; - options->timeout = 4; - options->sleep = 10* 120; /* 10 h in 30 seconds tick */ + options->timeout = 4; /* 4 tickles = 2 minutes */ + options->sleep = 10 * 60 * 2; /* 10 h in 30 seconds tick */ + options->disconnected = 10 * 60 * 2; /* 10 h in 30 seconds tick */ options->server_notif = 1; options->authprintdir = NULL; options->signatureopt = "auto"; @@ -185,6 +189,10 @@ void afp_options_init(struct afp_options *options) options->dircachesize = DEFAULT_MAX_DIRCACHE_SIZE; options->flags |= OPTION_ACL2MACCESS; options->flags |= OPTION_UUID; + options->tcp_sndbuf = 0; /* 0 means don't change OS default */ + options->tcp_rcvbuf = 0; /* 0 means don't change OS default */ + options->dsireadbuf = 12; + options->mimicmodel = NULL; } /* parse an afpd.conf line. i'm doing it this way because it's @@ -320,6 +328,12 @@ int afp_options_parseline(char *buf, struct afp_options *options) } } + if ((c = getoption(buf, "-dsireadbuf"))) { + options->dsireadbuf = atoi(c); + if (options->dsireadbuf < 6) + options->dsireadbuf = 6; + } + if ((c = getoption(buf, "-server_quantum"))) options->server_quantum = strtoul(c, NULL, 0); @@ -340,8 +354,11 @@ int afp_options_parseline(char *buf, struct afp_options *options) while (NULL != (c = strstr(c, "-setuplog"))) { char *optstr; if ((optstr = getoption(c, "-setuplog"))) { + /* hokey2: options->logconfig must be converted to store an array of logstrings */ + if (options->logconfig) + free(options->logconfig); + options->logconfig = strdup(optstr); setuplog(optstr); - options->logconfig = optstr; /* at least store the last (possibly only) one */ c += sizeof("-setuplog"); } } @@ -406,10 +423,6 @@ int afp_options_parseline(char *buf, struct afp_options *options) if ((c = getoption(buf, "-port"))) options->port = strdup(c); -#ifndef NO_DDP - if ((c = getoption(buf, "-ddpaddr"))) - atalk_aton(c, &options->ddpaddr); -#endif if ((c = getoption(buf, "-signature")) && (opt = strdup(c))) options->signatureopt = opt; @@ -464,6 +477,28 @@ int afp_options_parseline(char *buf, struct afp_options *options) if ((c = getoption(buf, "-dircachesize"))) options->dircachesize = atoi(c); + if ((c = getoption(buf, "-tcpsndbuf"))) + options->tcp_sndbuf = atoi(c); + + if ((c = getoption(buf, "-tcprcvbuf"))) + options->tcp_rcvbuf = atoi(c); + + if ((c = getoption(buf, "-fcelistener"))) { + LOG(log_note, logtype_afpd, "Adding fce listener \"%s\"", c); + fce_add_udp_socket(c); + } + if ((c = getoption(buf, "-fcecoalesce"))) { + LOG(log_note, logtype_afpd, "Fce coalesce: %s", c); + fce_set_coalesce(c); + } + if ((c = getoption(buf, "-fceevents"))) { + LOG(log_note, logtype_afpd, "Fce events: %s", c); + fce_set_events(c); + } + + if ((c = getoption(buf, "-mimicmodel")) && (opt = strdup(c))) + options->mimicmodel = opt; + return 1; } @@ -482,23 +517,10 @@ static void show_version( void ) puts( "afpd has been compiled with support for these features:\n" ); - printf( " AFP3.x support:\t" ); -#ifdef AFP3x - puts( "Yes" ); -#else - puts( "No" ); -#endif - + printf( " AFP3.x support:\tYes\n" ); printf( " TCP/IP Support:\t" ); puts( "Yes" ); - printf( "DDP(AppleTalk) Support:\t" ); -#ifdef NO_DDP - puts( "No" ); -#else - puts( "Yes" ); -#endif - printf( " CNID backends:\t" ); #ifdef CNID_BACKEND_CDB printf( "cdb "); @@ -585,20 +607,6 @@ static void show_version_extended(void ) puts( "No" ); #endif - printf( " Dropbox kludge:\t" ); -#ifdef DROPKLUDGE - puts( "Yes" ); -#else - puts( "No" ); -#endif - - printf( " Force volume uid/gid:\t" ); -#ifdef FORCE_UIDGID - puts( "Yes" ); -#else - puts( "No" ); -#endif - printf( " ACL support:\t" ); #ifdef HAVE_ACLS puts( "Yes" );