X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=etc%2Fafpd%2Fafp_options.c;h=3ad83fe26d19d1b872ef05b7bf78413ed82aa02b;hb=4054f4b3c85ecab060dafd46c0d3632cadbb5803;hp=407a594a769511d4aa39c9cbde24aba75b3c23a7;hpb=ffd50caa895e01aed02dcf0543700488463c3a2b;p=netatalk.git diff --git a/etc/afpd/afp_options.c b/etc/afpd/afp_options.c index 407a594a..3ad83fe2 100644 --- a/etc/afpd/afp_options.c +++ b/etc/afpd/afp_options.c @@ -34,6 +34,7 @@ #include #include #include +#include #include "globals.h" #include "status.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); @@ -462,6 +476,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; } @@ -480,13 +516,7 @@ 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" );