diff options
author | stderr64 <stderr64@null.net> | 2024-05-15 22:09:40 +0300 |
---|---|---|
committer | stderr64 <stderr64@null.net> | 2024-05-15 22:09:40 +0300 |
commit | bcb07c7207b1194cf032ed8f0f841b3c3e57367b (patch) | |
tree | 5b06fa8a28af0311e32a9f5fd98eafeaebf8e0b1 /https_server.h | |
parent | 2d22f149180ba28186cf142ec30dc91c841d0328 (diff) | |
download | CWebHook-master.tar.gz CWebHook-master.tar.zst |
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
Diffstat (limited to 'https_server.h')
-rw-r--r-- | https_server.h | 6 |
1 files changed, 3 insertions, 3 deletions
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 ){ |