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 (obj->options.tcp_rcvbuf) {
+ 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));
+ if (obj->options.tcp_sndbuf) {
+ 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 */
options->dircachesize = DEFAULT_MAX_DIRCACHE_SIZE;
options->flags |= OPTION_ACL2MACCESS;
options->flags |= OPTION_UUID;
- options->tcp_sndbuf = 65535;
- options->tcp_rcvbuf = 65535;
+ options->tcp_sndbuf = 0; /* 0 means don't change OS default */
+ options->tcp_rcvbuf = 0; /* 0 means don't change OS default */
}
/* parse an afpd.conf line. i'm doing it this way because it's