diff options
author | Test_User <hax@andrewyu.org> | 2023-06-18 19:28:52 -0400 |
---|---|---|
committer | Test_User <hax@andrewyu.org> | 2023-06-18 19:28:52 -0400 |
commit | 11c8d7a22b0d29278d9cc88b1a50ab974a1e6e6f (patch) | |
tree | a05f24e3517b1d0ac83c207f14f685738091fa42 /main.c | |
parent | 83cf1be35bbb7ba9868e61cb4a5406848e032c5a (diff) | |
download | coupserv-11c8d7a22b0d29278d9cc88b1a50ab974a1e6e6f.tar.gz coupserv-11c8d7a22b0d29278d9cc88b1a50ab974a1e6e6f.zip |
Add -Wsign-conversion, change related things to match as desired, move gnutls_record_recv to tls.h/tls.c
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) { |