diff options
Diffstat (limited to 'toxcore/TCP_server.c')
-rw-r--r-- | toxcore/TCP_server.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/toxcore/TCP_server.c b/toxcore/TCP_server.c index 5a5a55be..4b355a62 100644 --- a/toxcore/TCP_server.c +++ b/toxcore/TCP_server.c | |||
@@ -251,7 +251,7 @@ uint16_t read_TCP_length(sock_t sock) | |||
251 | 251 | ||
252 | if (count >= sizeof(uint16_t)) { | 252 | if (count >= sizeof(uint16_t)) { |
253 | uint16_t length; | 253 | uint16_t length; |
254 | int len = recv(sock, (uint8_t *)&length, sizeof(uint16_t), MSG_NOSIGNAL); | 254 | int len = recv(sock, (char *)&length, sizeof(uint16_t), MSG_NOSIGNAL); |
255 | 255 | ||
256 | if (len != sizeof(uint16_t)) { | 256 | if (len != sizeof(uint16_t)) { |
257 | fprintf(stderr, "FAIL recv packet\n"); | 257 | fprintf(stderr, "FAIL recv packet\n"); |
@@ -280,7 +280,7 @@ int read_TCP_packet(sock_t sock, uint8_t *data, uint16_t length) | |||
280 | unsigned int count = TCP_socket_data_recv_buffer(sock); | 280 | unsigned int count = TCP_socket_data_recv_buffer(sock); |
281 | 281 | ||
282 | if (count >= length) { | 282 | if (count >= length) { |
283 | int len = recv(sock, data, length, MSG_NOSIGNAL); | 283 | int len = recv(sock, (char *)data, length, MSG_NOSIGNAL); |
284 | 284 | ||
285 | if (len != length) { | 285 | if (len != length) { |
286 | fprintf(stderr, "FAIL recv packet\n"); | 286 | fprintf(stderr, "FAIL recv packet\n"); |
@@ -348,7 +348,7 @@ static int send_pending_data_nonpriority(TCP_Secure_Connection *con) | |||
348 | } | 348 | } |
349 | 349 | ||
350 | uint16_t left = con->last_packet_length - con->last_packet_sent; | 350 | uint16_t left = con->last_packet_length - con->last_packet_sent; |
351 | int len = send(con->sock, con->last_packet + con->last_packet_sent, left, MSG_NOSIGNAL); | 351 | int len = send(con->sock, (const char *)(con->last_packet + con->last_packet_sent), left, MSG_NOSIGNAL); |
352 | 352 | ||
353 | if (len <= 0) { | 353 | if (len <= 0) { |
354 | return -1; | 354 | return -1; |
@@ -378,7 +378,7 @@ static int send_pending_data(TCP_Secure_Connection *con) | |||
378 | 378 | ||
379 | while (p) { | 379 | while (p) { |
380 | uint16_t left = p->size - p->sent; | 380 | uint16_t left = p->size - p->sent; |
381 | int len = send(con->sock, p->data + p->sent, left, MSG_NOSIGNAL); | 381 | int len = send(con->sock, (const char *)(p->data + p->sent), left, MSG_NOSIGNAL); |
382 | 382 | ||
383 | if (len != left) { | 383 | if (len != left) { |
384 | if (len > 0) { | 384 | if (len > 0) { |
@@ -462,7 +462,7 @@ static int write_packet_TCP_secure_connection(TCP_Secure_Connection *con, const | |||
462 | } | 462 | } |
463 | 463 | ||
464 | if (priority) { | 464 | if (priority) { |
465 | len = sendpriority ? send(con->sock, packet, sizeof(packet), MSG_NOSIGNAL) : 0; | 465 | len = sendpriority ? send(con->sock, (const char *)packet, sizeof(packet), MSG_NOSIGNAL) : 0; |
466 | 466 | ||
467 | if (len <= 0) { | 467 | if (len <= 0) { |
468 | len = 0; | 468 | len = 0; |
@@ -477,7 +477,7 @@ static int write_packet_TCP_secure_connection(TCP_Secure_Connection *con, const | |||
477 | return add_priority(con, packet, sizeof(packet), len); | 477 | return add_priority(con, packet, sizeof(packet), len); |
478 | } | 478 | } |
479 | 479 | ||
480 | len = send(con->sock, packet, sizeof(packet), MSG_NOSIGNAL); | 480 | len = send(con->sock, (const char *)packet, sizeof(packet), MSG_NOSIGNAL); |
481 | 481 | ||
482 | if (len <= 0) { | 482 | if (len <= 0) { |
483 | return 0; | 483 | return 0; |
@@ -574,7 +574,7 @@ static int handle_TCP_handshake(TCP_Secure_Connection *con, const uint8_t *data, | |||
574 | return -1; | 574 | return -1; |
575 | } | 575 | } |
576 | 576 | ||
577 | if (TCP_SERVER_HANDSHAKE_SIZE != send(con->sock, response, TCP_SERVER_HANDSHAKE_SIZE, MSG_NOSIGNAL)) { | 577 | if (TCP_SERVER_HANDSHAKE_SIZE != send(con->sock, (const char *)response, TCP_SERVER_HANDSHAKE_SIZE, MSG_NOSIGNAL)) { |
578 | return -1; | 578 | return -1; |
579 | } | 579 | } |
580 | 580 | ||