diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/client.c | 12 |
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 @@ | |||
| 30 | #include <unistd.h> | 30 | #include <unistd.h> |
| 31 | #include <sys/types.h> | 31 | #include <sys/types.h> |
| 32 | #include <sys/socket.h> | 32 | #include <sys/socket.h> |
| 33 | #include <netinet/tcp.h> | ||
| 33 | #include <sys/un.h> | 34 | #include <sys/un.h> |
| 34 | #include <arpa/inet.h> | 35 | #include <arpa/inet.h> |
| 35 | #include <pthread.h> | 36 | #include <pthread.h> |
| @@ -171,6 +172,17 @@ int client_accept(int listenfd) | |||
| 171 | } | 172 | } |
| 172 | } | 173 | } |
| 173 | 174 | ||
| 175 | int bufsize = 0x20000; | ||
| 176 | if (setsockopt(cfd, SOL_SOCKET, SO_SNDBUF, &bufsize, sizeof(int)) == -1) { | ||
| 177 | usbmuxd_log(LL_WARNING, "Could not set send buffer for client socket"); | ||
| 178 | } | ||
| 179 | if (setsockopt(cfd, SOL_SOCKET, SO_RCVBUF, &bufsize, sizeof(int)) == -1) { | ||
| 180 | usbmuxd_log(LL_WARNING, "Could not set receive buffer for client socket"); | ||
| 181 | } | ||
| 182 | |||
| 183 | int yes = 1; | ||
| 184 | setsockopt(cfd, IPPROTO_TCP, TCP_NODELAY, (void*)&yes, sizeof(int)); | ||
| 185 | |||
| 174 | struct mux_client *client; | 186 | struct mux_client *client; |
| 175 | client = malloc(sizeof(struct mux_client)); | 187 | client = malloc(sizeof(struct mux_client)); |
| 176 | memset(client, 0, sizeof(struct mux_client)); | 188 | memset(client, 0, sizeof(struct mux_client)); |
