X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=etc%2Fafpd%2Fafp_options.c;h=b79bc8d1f443329bb220f5dbbf408e60e1e390b2;hb=e22bbf78a53bf739dd38383de42a23c95d43c15d;hp=f3724c13cdbd6d05f8403b6a753839e9c1f207c0;hpb=5825df1c826101269dccd558ac9ac85c0dcd4e36;p=netatalk.git diff --git a/etc/afpd/afp_options.c b/etc/afpd/afp_options.c index f3724c13..b79bc8d1 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 */ @@ -189,6 +192,7 @@ void afp_options_init(struct afp_options *options) 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 @@ -350,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"); } } @@ -478,6 +485,22 @@ int afp_options_parseline(char *buf, struct afp_options *options) 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; }