X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=etc%2Fafpd%2Fafp_options.c;h=5cb205dbe7199eb2d6966533490d4538af8ee75e;hb=465246e257d9aff9855e3e35d8fd5983db932b45;hp=e513821789bac0dba5e197a8336be5182baf4464;hpb=8ea9eaad323ec8ea180ffc277cd409d713a5895f;p=netatalk.git diff --git a/etc/afpd/afp_options.c b/etc/afpd/afp_options.c index e5138217..5cb205db 100644 --- a/etc/afpd/afp_options.c +++ b/etc/afpd/afp_options.c @@ -34,8 +34,8 @@ #include #include #include +#include -#include "globals.h" #include "status.h" #include "auth.h" #include "dircache.h" @@ -186,6 +186,9 @@ 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; } /* parse an afpd.conf line. i'm doing it this way because it's @@ -321,6 +324,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); @@ -341,8 +350,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"); } } @@ -463,6 +475,12 @@ 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); + return 1; }