Changeset View
Changeset View
Standalone View
Standalone View
contrib/tnftp/src/util.c
Show First 20 Lines • Show All 1,081 Lines • ▼ Show 20 Lines | if (0 == sndbuf_size) { | ||||
if (sndbuf_size <= 0) | if (sndbuf_size <= 0) | ||||
sndbuf_size = 8 * 1024; | sndbuf_size = 8 * 1024; | ||||
if (sndbuf_size > 8 * 1024 * 1024) | if (sndbuf_size > 8 * 1024 * 1024) | ||||
sndbuf_size = 8 * 1024 * 1024; | sndbuf_size = 8 * 1024 * 1024; | ||||
DPRINTF("setupsockbufsize: sndbuf_size determined as %d\n", | DPRINTF("setupsockbufsize: sndbuf_size determined as %d\n", | ||||
sndbuf_size); | sndbuf_size); | ||||
} | } | ||||
#ifdef __FreeBSD__ | |||||
DPRINTF("auto_rcvbuf = %d\n", auto_rcvbuf); | |||||
if (auto_sndbuf == 0) { | |||||
#endif | |||||
if (setsockopt(sock, SOL_SOCKET, SO_SNDBUF, | if (setsockopt(sock, SOL_SOCKET, SO_SNDBUF, | ||||
(void *)&sndbuf_size, sizeof(sndbuf_size)) == -1) | (void *)&sndbuf_size, sizeof(sndbuf_size)) == -1) | ||||
warn("Unable to set sndbuf size %d", sndbuf_size); | warn("Unable to set sndbuf size %d", sndbuf_size); | ||||
#ifdef __FreeBSD__ | |||||
} | |||||
#endif | |||||
#ifdef __FreeBSD__ | |||||
DPRINTF("auto_sndbuf = %d\n", auto_sndbuf); | |||||
if (auto_rcvbuf == 0) { | |||||
#endif | |||||
if (setsockopt(sock, SOL_SOCKET, SO_RCVBUF, | if (setsockopt(sock, SOL_SOCKET, SO_RCVBUF, | ||||
(void *)&rcvbuf_size, sizeof(rcvbuf_size)) == -1) | (void *)&rcvbuf_size, sizeof(rcvbuf_size)) == -1) | ||||
warn("Unable to set rcvbuf size %d", rcvbuf_size); | warn("Unable to set rcvbuf size %d", rcvbuf_size); | ||||
#ifdef __FreeBSD__ | |||||
} | |||||
#endif | |||||
} | } | ||||
/* | /* | ||||
* Copy characters from src into dst, \ quoting characters that require it | * Copy characters from src into dst, \ quoting characters that require it | ||||
*/ | */ | ||||
void | void | ||||
ftpvis(char *dst, size_t dstlen, const char *src, size_t srclen) | ftpvis(char *dst, size_t dstlen, const char *src, size_t srclen) | ||||
{ | { | ||||
▲ Show 20 Lines • Show All 476 Lines • Show Last 20 Lines |