Changes in 2.2beta4
===================
+* NEW: afpd: new afpd.conf optinos "tcprcvbuf" and "tcpsndbuf" to customize
+ the corresponding TCP socket options.
* FIX: afpd: generate mersenne primes for DHX2 UAM once at startup,
not for every login
* FIX: Support for platforms that do not have the *at functions
if (dircache_init(obj->options.dircachesize) != 0)
afp_dsi_die(EXITERR_SYS);
+ /* set TCP snd/rcv buf */
+ if (setsockopt(dsi->socket,
+ SOL_SOCKET,
+ SO_RCVBUF,
+ &obj->options.tcp_rcvbuf,
+ sizeof(obj->options.tcp_rcvbuf)) != 0) {
+ LOG(log_error, logtype_dsi, "dsi_tcp_open: setsockopt(SO_RCVBUF): %s", strerror(errno));
+ }
+ if (setsockopt(dsi->socket,
+ SOL_SOCKET,
+ SO_SNDBUF,
+ &obj->options.tcp_sndbuf,
+ sizeof(obj->options.tcp_sndbuf)) != 0) {
+ LOG(log_error, logtype_dsi, "dsi_tcp_open: setsockopt(SO_SNDBUF): %s", strerror(errno));
+ }
+
/* get stuck here until the end */
while (1) {
if (sigsetjmp(recon_jmp, 1) != 0)
options->dircachesize = DEFAULT_MAX_DIRCACHE_SIZE;
options->flags |= OPTION_ACL2MACCESS;
options->flags |= OPTION_UUID;
+ options->tcp_sndbuf = 65535;
+ options->tcp_rcvbuf = 65535;
}
/* parse an afpd.conf line. i'm doing it this way because it's
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;
}
int connections, transports, tickleval, timeout, server_notif, flags, dircachesize;
int sleep; /* Maximum time allowed to sleep (in tickles) */
int disconnected; /* Maximum time in disconnected state (in tickles) */
+ unsigned int tcp_sndbuf, tcp_rcvbuf;
unsigned char passwdbits, passwdminlen, loginmaxfail;
u_int32_t server_quantum;
char hostname[MAXHOSTNAMELEN + 1], *server, *ipaddr, *port, *configfile;