From bcb07c7207b1194cf032ed8f0f841b3c3e57367b Mon Sep 17 00:00:00 2001 From: stderr64 Date: Wed, 15 May 2024 22:09:40 +0300 Subject: Change long long int to int64_t and ssize_t Because long long int is bad idea, using int64_t and ssize_t it can at least be expected that the max and minimum values are for each --- https_server.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'https_server.h') diff --git a/https_server.h b/https_server.h index 80fb77a..d7ec5e1 100644 --- a/https_server.h +++ b/https_server.h @@ -65,7 +65,7 @@ void https_server_event_loop( server_socket_t *sv, client_info_t *cl, server_con log_write( svcfg, logf, "Error: failed to allocate memory for reading amount of incoming data" ); continue; } - sv->recv_pending_bytes = (long long int)SSL_peek( sv->tls_session, sv->recv_peek, (long long int)MAX_PEEK_BYTES ); + sv->recv_pending_bytes = (int64_t)SSL_peek( sv->tls_session, sv->recv_peek, (int64_t)MAX_PEEK_BYTES ); if ( sv->recv_pending_bytes <= 0 || SSL_get_error(sv->tls_session, sv->recv_pending_bytes) != SSL_ERROR_NONE ){ free( sv->recv_peek ); sv->recv_peek = NULL; @@ -80,7 +80,7 @@ void https_server_event_loop( server_socket_t *sv, client_info_t *cl, server_con } free( sv->recv_peek ); sv->recv_peek = NULL; - if ( sv->recv_pending_bytes > (long long int)MAX_RECV_BYTES ){ + if ( sv->recv_pending_bytes > (int64_t)MAX_RECV_BYTES ){ SSL_shutdown( sv->tls_session ); shutdown( sv->client_socket_fd, SHUT_RDWR ); close( sv->client_socket_fd ); @@ -98,7 +98,7 @@ void https_server_event_loop( server_socket_t *sv, client_info_t *cl, server_con log_write( svcfg, logf, "Error: failed to allocate memory for received bytes" ); continue; } - sv->recv_read_bytes = (long long int)SSL_read( sv->tls_session, sv->recv_data, sv->recv_pending_bytes ); + sv->recv_read_bytes = (int64_t)SSL_read( sv->tls_session, sv->recv_data, sv->recv_pending_bytes ); if ( sv->recv_read_bytes > 0 && SSL_get_error(sv->tls_session, sv->recv_read_bytes) == SSL_ERROR_NONE ){ int res_status = send_response( sv, svcfg, wdata, http_req_data, logf ); if ( res_status == RES_SUCCESS ){ -- cgit v1.2.3-86-g962b