diff options
Diffstat (limited to '')
-rw-r--r-- | main.c | 14 |
1 files changed, 2 insertions, 12 deletions
@@ -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) { |