summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/client.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/client.c b/src/client.c
index a9d09d3..a9c986a 100644
--- a/src/client.c
+++ b/src/client.c
@@ -30,6 +30,7 @@
#include <unistd.h>
#include <sys/types.h>
#include <sys/socket.h>
+#include <netinet/tcp.h>
#include <sys/un.h>
#include <arpa/inet.h>
#include <pthread.h>
@@ -171,6 +172,17 @@ int client_accept(int listenfd)
}
}
+ int bufsize = 0x20000;
+ if (setsockopt(cfd, SOL_SOCKET, SO_SNDBUF, &bufsize, sizeof(int)) == -1) {
+ usbmuxd_log(LL_WARNING, "Could not set send buffer for client socket");
+ }
+ if (setsockopt(cfd, SOL_SOCKET, SO_RCVBUF, &bufsize, sizeof(int)) == -1) {
+ usbmuxd_log(LL_WARNING, "Could not set receive buffer for client socket");
+ }
+
+ int yes = 1;
+ setsockopt(cfd, IPPROTO_TCP, TCP_NODELAY, (void*)&yes, sizeof(int));
+
struct mux_client *client;
client = malloc(sizeof(struct mux_client));
memset(client, 0, sizeof(struct mux_client));