summaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'main.c')
-rw-r--r--main.c14
1 files changed, 2 insertions, 12 deletions
diff --git a/main.c b/main.c
index 3618105..0fdd429 100644
--- a/main.c
+++ b/main.c
@@ -57,7 +57,7 @@ void *client_loop(void *ign) {
if (len < 0)
new_len = 0;
else
- new_len = len;
+ new_len = (size_t)len;
}
pthread_mutex_lock(&send_lock);
@@ -230,18 +230,8 @@ int main(void) {
struct string full_msg = {malloc(0), 0};
while (1) {
char data[512];
- uint64_t new_len;
pthread_mutex_unlock(&send_lock);
- {
- int len;
- do {
- len = gnutls_record_recv(session, data, 512);
- } while (len == GNUTLS_E_AGAIN || len == GNUTLS_E_INTERRUPTED);
- if (len < 0)
- new_len = 0;
- else
- new_len = len;
- }
+ uint64_t new_len = RECV(data, sizeof(data));
pthread_mutex_lock(&send_lock);
if (new_len == 0) {