If we get a write <-> write connection, don't waste space buffering data we won't use.

This commit is contained in:
Ian Gulliver
2016-02-28 22:50:26 -08:00
parent 49b6b0083b
commit 5c7bf0b395

View File

@@ -35,6 +35,10 @@ void socket_send_init(int fd) {
// Called by data flow code; NOT safe to assume that fd is a socket
int res = shutdown(fd, SHUT_RD);
assert(res == 0 || (res == -1 && errno == ENOTSOCK));
int optval = 128; // Lowest value that the kernel will accept
res = setsockopt(fd, SOL_SOCKET, SO_RCVBUF, &optval, sizeof(optval));
assert(res == 0 || (res == -1 && errno == ENOTSOCK));
}
void socket_receive_init(int fd) {