diff --git a/Makefile b/Makefile index 820cbdd6..9f28d004 100644 --- a/Makefile +++ b/Makefile @@ -294,7 +294,6 @@ OBJLIST = \ ${OBJDIR}httplib_read_request${OBJEXT} \ ${OBJDIR}httplib_read_websocket${OBJEXT} \ ${OBJDIR}httplib_readdir${OBJEXT} \ - ${OBJDIR}httplib_realloc2${OBJEXT} \ ${OBJDIR}httplib_redirect_to_https_port${OBJEXT} \ ${OBJDIR}httplib_refresh_trust${OBJEXT} \ ${OBJDIR}httplib_remove${OBJEXT} \ @@ -433,7 +432,6 @@ ${OBJDIR}httplib_accept_new_connection${OBJEXT} : ${SRCDIR}httplib_accept_new ${INCDIR}libhttp.h ${OBJDIR}httplib_addenv${OBJEXT} : ${SRCDIR}httplib_addenv.c \ - ${SRCDIR}httplib_memory.h \ ${SRCDIR}httplib_string.h \ ${SRCDIR}httplib_utils.h \ ${SRCDIR}httplib_main.h \ @@ -476,12 +474,10 @@ ${OBJDIR}httplib_check_password${OBJEXT} : ${SRCDIR}httplib_check_password.c ${INCDIR}libhttp.h ${OBJDIR}httplib_close_all_listening_sockets${OBJDIR} : ${SRCDIR}httplib_close_all_listening_sockets.c \ - ${SRCDIR}httplib_memory.h \ ${SRCDIR}httplib_main.h \ ${INCDIR}libhttp.h ${OBJDIR}httplib_close_connection${OBJEXT} : ${SRCDIR}httplib_close_connection.c \ - ${SRCDIR}httplib_memory.h \ ${SRCDIR}httplib_pthread.h \ ${SRCDIR}httplib_ssl.h \ ${SRCDIR}httplib_main.h \ @@ -492,7 +488,6 @@ ${OBJDIR}httplib_close_socket_gracefully${OBJEXT} : ${SRCDIR}httplib_close_soc ${INCDIR}libhttp.h ${OBJDIR}httplib_closedir${OBJEXT} : ${SRCDIR}httplib_closedir.c \ - ${SRCDIR}httplib_memory.h \ ${SRCDIR}httplib_main.h \ ${INCDIR}libhttp.h @@ -505,7 +500,6 @@ ${OBJDIR}httplib_config_options${OBJEXT} : ${SRCDIR}httplib_config_options.c ${INCDIR}libhttp.h ${OBJDIR}httplib_connect_client${OBJEXT} : ${SRCDIR}httplib_connect_client.c \ - ${SRCDIR}httplib_memory.h \ ${SRCDIR}httplib_pthread.h \ ${SRCDIR}httplib_ssl.h \ ${SRCDIR}httplib_string.h \ @@ -513,7 +507,6 @@ ${OBJDIR}httplib_connect_client${OBJEXT} : ${SRCDIR}httplib_connect_client.c ${INCDIR}libhttp.h ${OBJDIR}httplib_connect_socket${OBJEXT} : ${SRCDIR}httplib_connect_socket.c \ - ${SRCDIR}httplib_memory.h \ ${SRCDIR}httplib_ssl.h \ ${SRCDIR}httplib_string.h \ ${SRCDIR}httplib_utils.h \ @@ -521,7 +514,6 @@ ${OBJDIR}httplib_connect_socket${OBJEXT} : ${SRCDIR}httplib_connect_socket.c ${INCDIR}libhttp.h ${OBJDIR}httplib_connect_websocket_client${OBJEXT} : ${SRCDIR}httplib_connect_websocket_client.c \ - ${SRCDIR}httplib_memory.h \ ${SRCDIR}httplib_string.h \ ${SRCDIR}httplib_main.h \ ${INCDIR}libhttp.h @@ -551,7 +543,6 @@ ${OBJDIR}httplib_difftimespec${OBJEXT} : ${SRCDIR}httplib_difftimespec.c ${INCDIR}libhttp.h ${OBJDIR}httplib_dir_scan_callback${OBJEXT} : ${SRCDIR}httplib_dir_scan_callback.c \ - ${SRCDIR}httplib_memory.h \ ${SRCDIR}httplib_string.h \ ${SRCDIR}httplib_main.h \ ${INCDIR}libhttp.h @@ -594,7 +585,6 @@ ${OBJDIR}httplib_forward_body_data${OBJEXT} : ${SRCDIR}httplib_forward_body_d ${INCDIR}libhttp.h ${OBJDIR}httplib_free_context${OBJEXT} : ${SRCDIR}httplib_free_context.c \ - ${SRCDIR}httplib_memory.h \ ${SRCDIR}httplib_pthread.h \ ${SRCDIR}httplib_ssl.h \ ${SRCDIR}httplib_utils.h \ @@ -715,13 +705,11 @@ ${OBJDIR}httplib_gmt_time_string${OBJEXT} : ${SRCDIR}httplib_gmt_time_string. ${INCDIR}libhttp.h ${OBJDIR}httplib_handle_cgi_request${OBJEXT} : ${SRCDIR}httplib_handle_cgi_request.c \ - ${SRCDIR}httplib_memory.h \ ${SRCDIR}httplib_string.h \ ${SRCDIR}httplib_main.h \ ${INCDIR}libhttp.h ${OBJDIR}httplib_handle_directory_request${OBJEXT} : ${SRCDIR}httplib_handle_directory_request.c \ - ${SRCDIR}httplib_memory.h \ ${SRCDIR}httplib_utils.h \ ${SRCDIR}httplib_main.h \ ${INCDIR}libhttp.h @@ -731,7 +719,6 @@ ${OBJDIR}httplib_handle_file_based_request${OBJEXT} : ${SRCDIR}httplib_handle_ ${INCDIR}libhttp.h ${OBJDIR}httplib_handle_form_request${OBJEXT} : ${SRCDIR}httplib_handle_form_request.c \ - ${SRCDIR}httplib_memory.h \ ${SRCDIR}httplib_main.h \ ${INCDIR}libhttp.h @@ -772,7 +759,6 @@ ${OBJDIR}httplib_inet_pton${OBJEXT} : ${SRCDIR}httplib_inet_pton.c \ ${INCDIR}libhttp.h ${OBJDIR}httplib_initialize_ssl${OBJEXT} : ${SRCDIR}httplib_initialize_ssl.c \ - ${SRCDIR}httplib_memory.h \ ${SRCDIR}httplib_pthread.h \ ${SRCDIR}httplib_ssl.h \ ${SRCDIR}httplib_utils.h \ @@ -852,7 +838,6 @@ ${OBJDIR}httplib_lowercase${OBJEXT} : ${SRCDIR}httplib_lowercase.c \ ${INCDIR}libhttp.h ${OBJDIR}httplib_malloc${OBJEXT} : ${SRCDIR}httplib_malloc.c \ - ${SRCDIR}httplib_memory.h \ ${SRCDIR}httplib_main.h \ ${INCDIR}libhttp.h @@ -898,7 +883,6 @@ ${OBJDIR}httplib_open_auth_file${OBJEXT} : ${SRCDIR}httplib_open_auth_file.c ${INCDIR}libhttp.h ${OBJDIR}httplib_opendir${OBJEXT} : ${SRCDIR}httplib_opendir.c \ - ${SRCDIR}httplib_memory.h \ ${SRCDIR}httplib_main.h \ ${INCDIR}libhttp.h @@ -937,7 +921,6 @@ ${OBJDIR}httplib_poll${OBJEXT} : ${SRCDIR}httplib_poll.c \ ${INCDIR}libhttp.h ${OBJDIR}httplib_prepare_cgi_environment${OBJEXT} : ${SRCDIR}httplib_prepare_cgi_environment.c \ - ${SRCDIR}httplib_memory.h \ ${SRCDIR}httplib_ssl.h \ ${SRCDIR}httplib_string.h \ ${SRCDIR}httplib_utils.h \ @@ -955,7 +938,6 @@ ${OBJDIR}httplib_printf${OBJEXT} : ${SRCDIR}httplib_printf.c \ ${INCDIR}libhttp.h ${OBJDIR}httplib_process_new_connection${OBJEXT} : ${SRCDIR}httplib_process_new_connection.c \ - ${SRCDIR}httplib_memory.h \ ${SRCDIR}httplib_string.h \ ${SRCDIR}httplib_main.h \ ${INCDIR}libhttp.h @@ -1004,7 +986,6 @@ ${OBJDIR}httplib_read_request${OBJEXT} : ${SRCDIR}httplib_read_request.c ${INCDIR}libhttp.h ${OBJDIR}httplib_read_websocket${OBJEXT} : ${SRCDIR}httplib_read_websocket.c \ - ${SRCDIR}httplib_memory.h \ ${SRCDIR}httplib_main.h \ ${INCDIR}libhttp.h @@ -1012,11 +993,6 @@ ${OBJDIR}httplib_readdir${OBJEXT} : ${SRCDIR}httplib_readdir.c \ ${SRCDIR}httplib_main.h \ ${INCDIR}libhttp.h -${OBJDIR}httplib_realloc2${OBJEXT} : ${SRCDIR}httplib_realloc2.c \ - ${SRCDIR}httplib_memory.h \ - ${SRCDIR}httplib_main.h \ - ${INCDIR}libhttp.h - ${OBJDIR}httplib_redirect_to_https_port${OBJEXT} : ${SRCDIR}httplib_redirect_to_https_port.c \ ${SRCDIR}httplib_string.h \ ${SRCDIR}httplib_main.h \ @@ -1110,7 +1086,6 @@ ${OBJDIR}httplib_set_gpass_option${OBJEXT} : ${SRCDIR}httplib_set_gpass_optio ${INCDIR}libhttp.h ${OBJDIR}httplib_set_handler_type${OBJEXT} : ${SRCDIR}httplib_set_handler_type.c \ - ${SRCDIR}httplib_memory.h \ ${SRCDIR}httplib_string.h \ ${SRCDIR}httplib_main.h \ ${INCDIR}libhttp.h @@ -1120,7 +1095,6 @@ ${OBJDIR}httplib_set_non_blocking_mode${OBJEXT} : ${SRCDIR}httplib_set_non_bl ${INCDIR}libhttp.h ${OBJDIR}httplib_set_ports_option${OBJEXT} : ${SRCDIR}httplib_set_ports_option.c \ - ${SRCDIR}httplib_memory.h \ ${SRCDIR}httplib_utils.h \ ${SRCDIR}httplib_main.h \ ${INCDIR}libhttp.h @@ -1206,7 +1180,6 @@ ${OBJDIR}httplib_ssl_error${OBJEXT} : ${SRCDIR}httplib_ssl_error.c \ ${INCDIR}libhttp.h ${OBJDIR}httplib_ssl_get_client_cert_info${OBJEXT} : ${SRCDIR}httplib_ssl_get_client_cert_info.c \ - ${SRCDIR}httplib_memory.h \ ${SRCDIR}httplib_ssl.h \ ${SRCDIR}httplib_string.h \ ${SRCDIR}httplib_main.h \ @@ -1218,7 +1191,6 @@ ${OBJDIR}httplib_ssl_get_protocol${OBJEXT} : ${SRCDIR}httplib_ssl_get_protoco ${INCDIR}libhttp.h ${OBJDIR}httplib_ssl_id_callback${OBJEXT} : ${SRCDIR}httplib_ssl_id_callback.c \ - ${SRCDIR}httplib_memory.h \ ${SRCDIR}httplib_pthread.h \ ${SRCDIR}httplib_ssl.h \ ${SRCDIR}httplib_utils.h \ @@ -1242,7 +1214,6 @@ ${OBJDIR}httplib_sslize${OBJEXT} : ${SRCDIR}httplib_sslize.c \ ${INCDIR}libhttp.h ${OBJDIR}httplib_start${OBJEXT} : ${SRCDIR}httplib_start.c \ - ${SRCDIR}httplib_memory.h \ ${SRCDIR}httplib_pthread.h \ ${SRCDIR}httplib_ssl.h \ ${SRCDIR}httplib_string.h \ @@ -1294,7 +1265,6 @@ ${OBJDIR}httplib_strncasecmp${OBJEXT} : ${SRCDIR}httplib_strncasecmp.c \ ${INCDIR}libhttp.h ${OBJDIR}httplib_strndup${OBJEXT} : ${SRCDIR}httplib_strndup.c \ - ${SRCDIR}httplib_memory.h \ ${SRCDIR}httplib_main.h \ ${INCDIR}libhttp.h @@ -1312,14 +1282,12 @@ ${OBJDIR}httplib_timer${OBJEXT} : ${SRCDIR}httplib_timer.c \ ${INCDIR}libhttp.h ${OBJDIR}httplib_tls_dtor${OBJEXT} : ${SRCDIR}httplib_tls_dtor.c \ - ${SRCDIR}httplib_memory.h \ ${SRCDIR}httplib_pthread.h \ ${SRCDIR}httplib_ssl.h \ ${SRCDIR}httplib_main.h \ ${INCDIR}libhttp.h ${OBJDIR}httplib_uninitialize_ssl${OBJEXT} : ${SRCDIR}httplib_uninitialize_ssl.c \ - ${SRCDIR}httplib_memory.h \ ${SRCDIR}httplib_pthread.h \ ${SRCDIR}httplib_ssl.h \ ${SRCDIR}httplib_utils.h \ @@ -1339,7 +1307,6 @@ ${OBJDIR}httplib_version${OBJEXT} : ${SRCDIR}httplib_version.c \ ${INCDIR}libhttp.h ${OBJDIR}httplib_vprintf${OBJEXT} : ${SRCDIR}httplib_vprintf.c \ - ${SRCDIR}httplib_memory.h \ ${SRCDIR}httplib_string.h \ ${SRCDIR}httplib_main.h \ ${INCDIR}libhttp.h @@ -1350,12 +1317,10 @@ ${OBJDIR}httplib_vsnprintf${OBJEXT} : ${SRCDIR}httplib_vsnprintf.c \ ${INCDIR}libhttp.h ${OBJDIR}httplib_websocket_client_thread${OBJEXT} : ${SRCDIR}httplib_websocket_client_thread.c \ - ${SRCDIR}httplib_memory.h \ ${SRCDIR}httplib_main.h \ ${INCDIR}libhttp.h ${OBJDIR}httplib_websocket_client_write${OBJEXT} : ${SRCDIR}httplib_websocket_client_write.c \ - ${SRCDIR}httplib_memory.h \ ${SRCDIR}httplib_utils.h \ ${SRCDIR}httplib_main.h \ ${INCDIR}libhttp.h @@ -1369,7 +1334,6 @@ ${OBJDIR}httplib_websocket_write_exec${OBJEXT} : ${SRCDIR}httplib_websocket_w ${INCDIR}libhttp.h ${OBJDIR}httplib_worker_thread${OBJEXT} : ${SRCDIR}httplib_worker_thread.c \ - ${SRCDIR}httplib_memory.h \ ${SRCDIR}httplib_pthread.h \ ${SRCDIR}httplib_ssl.h \ ${SRCDIR}httplib_utils.h \ diff --git a/src/httplib_addenv.c b/src/httplib_addenv.c index 1aa9e98c..dda9027b 100644 --- a/src/httplib_addenv.c +++ b/src/httplib_addenv.c @@ -26,7 +26,6 @@ */ #include "httplib_main.h" -#include "httplib_memory.h" #include "httplib_string.h" #include "httplib_utils.h" diff --git a/src/httplib_close_all_listening_sockets.c b/src/httplib_close_all_listening_sockets.c index bdbaac18..369498aa 100644 --- a/src/httplib_close_all_listening_sockets.c +++ b/src/httplib_close_all_listening_sockets.c @@ -26,7 +26,6 @@ */ #include "httplib_main.h" -#include "httplib_memory.h" /* * void XX_httplib_close_all_listening_sockets( struct httplib_context *ctx ); diff --git a/src/httplib_close_connection.c b/src/httplib_close_connection.c index b1c8d6ab..9cccb193 100644 --- a/src/httplib_close_connection.c +++ b/src/httplib_close_connection.c @@ -26,7 +26,6 @@ */ #include "httplib_main.h" -#include "httplib_memory.h" #include "httplib_pthread.h" #include "httplib_ssl.h" diff --git a/src/httplib_closedir.c b/src/httplib_closedir.c index 96b7ed12..ffc18f1d 100644 --- a/src/httplib_closedir.c +++ b/src/httplib_closedir.c @@ -26,7 +26,6 @@ */ #include "httplib_main.h" -#include "httplib_memory.h" /* * int httplib_closedir( DIR *dir ); diff --git a/src/httplib_connect_client.c b/src/httplib_connect_client.c index 7587edd3..1e22bc8f 100644 --- a/src/httplib_connect_client.c +++ b/src/httplib_connect_client.c @@ -26,7 +26,6 @@ */ #include "httplib_main.h" -#include "httplib_memory.h" #include "httplib_pthread.h" #include "httplib_ssl.h" #include "httplib_string.h" diff --git a/src/httplib_connect_socket.c b/src/httplib_connect_socket.c index d4be44cc..e191e530 100644 --- a/src/httplib_connect_socket.c +++ b/src/httplib_connect_socket.c @@ -26,7 +26,6 @@ */ #include "httplib_main.h" -#include "httplib_memory.h" #include "httplib_ssl.h" #include "httplib_string.h" #include "httplib_utils.h" diff --git a/src/httplib_connect_websocket_client.c b/src/httplib_connect_websocket_client.c index 44242360..8e1317c3 100644 --- a/src/httplib_connect_websocket_client.c +++ b/src/httplib_connect_websocket_client.c @@ -26,7 +26,6 @@ */ #include "httplib_main.h" -#include "httplib_memory.h" #include "httplib_string.h" /* diff --git a/src/httplib_dir_scan_callback.c b/src/httplib_dir_scan_callback.c index 7a3a00f9..2850f84f 100644 --- a/src/httplib_dir_scan_callback.c +++ b/src/httplib_dir_scan_callback.c @@ -26,20 +26,24 @@ */ #include "httplib_main.h" -#include "httplib_memory.h" #include "httplib_string.h" void XX_httplib_dir_scan_callback( struct de *de, void *data ) { struct dir_scan_data *dsd; + struct de* old_entries; dsd = data; if ( dsd->entries == NULL || dsd->num_entries >= dsd->arr_size ) { dsd->arr_size *= 2; - dsd->entries = XX_httplib_realloc2( dsd->entries, dsd->arr_size * sizeof(dsd->entries[0]) ); + old_entries = dsd->entries; + dsd->entries = httplib_realloc( old_entries, dsd->arr_size * sizeof(dsd->entries[0]) ); + + if ( dsd->entries == NULL && old_entries != NULL ) httplib_free( old_entries ); } + if ( dsd->entries == NULL ) { /* diff --git a/src/httplib_free_context.c b/src/httplib_free_context.c index e577ded2..19b8156f 100644 --- a/src/httplib_free_context.c +++ b/src/httplib_free_context.c @@ -26,7 +26,6 @@ */ #include "httplib_main.h" -#include "httplib_memory.h" #include "httplib_pthread.h" #include "httplib_ssl.h" #include "httplib_utils.h" diff --git a/src/httplib_get_random.c b/src/httplib_get_random.c index c71bc418..d3679c52 100644 --- a/src/httplib_get_random.c +++ b/src/httplib_get_random.c @@ -20,9 +20,6 @@ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. - * - * ============ - * Release: 2.0 */ #include "httplib_main.h" diff --git a/src/httplib_handle_cgi_request.c b/src/httplib_handle_cgi_request.c index f713e20b..506d5c0d 100644 --- a/src/httplib_handle_cgi_request.c +++ b/src/httplib_handle_cgi_request.c @@ -26,7 +26,6 @@ */ #include "httplib_main.h" -#include "httplib_memory.h" #include "httplib_string.h" /* diff --git a/src/httplib_handle_directory_request.c b/src/httplib_handle_directory_request.c index 9246a0ff..68140d54 100644 --- a/src/httplib_handle_directory_request.c +++ b/src/httplib_handle_directory_request.c @@ -26,7 +26,6 @@ */ #include "httplib_main.h" -#include "httplib_memory.h" #include "httplib_utils.h" void XX_httplib_handle_directory_request( struct httplib_connection *conn, const char *dir ) { diff --git a/src/httplib_handle_form_request.c b/src/httplib_handle_form_request.c index 89760ce3..57b208e1 100644 --- a/src/httplib_handle_form_request.c +++ b/src/httplib_handle_form_request.c @@ -25,7 +25,6 @@ */ #include "httplib_main.h" -#include "httplib_memory.h" static int url_encoded_field_found(const struct httplib_connection *conn, const char *key, diff --git a/src/httplib_initialize_ssl.c b/src/httplib_initialize_ssl.c index e84e03bb..b16960ca 100644 --- a/src/httplib_initialize_ssl.c +++ b/src/httplib_initialize_ssl.c @@ -26,7 +26,6 @@ */ #include "httplib_main.h" -#include "httplib_memory.h" #include "httplib_pthread.h" #include "httplib_ssl.h" #include "httplib_utils.h" diff --git a/src/httplib_malloc.c b/src/httplib_malloc.c index 6c097f73..203ef069 100644 --- a/src/httplib_malloc.c +++ b/src/httplib_malloc.c @@ -26,7 +26,6 @@ */ #include "httplib_main.h" -#include "httplib_memory.h" static int64_t httplib_memory_blocks_used = 0; static int64_t httplib_memory_bytes_used = 0; diff --git a/src/httplib_memory.h b/src/httplib_memory.h deleted file mode 100644 index 68da0206..00000000 --- a/src/httplib_memory.h +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (C) 2016 Lammert Bies - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -void * XX_httplib_realloc2( void *ptr, size_t size ); diff --git a/src/httplib_opendir.c b/src/httplib_opendir.c index c6691e49..3f4ed9ee 100644 --- a/src/httplib_opendir.c +++ b/src/httplib_opendir.c @@ -26,7 +26,6 @@ */ #include "httplib_main.h" -#include "httplib_memory.h" /* * DIR *httplib_opendir( const char *name ); diff --git a/src/httplib_prepare_cgi_environment.c b/src/httplib_prepare_cgi_environment.c index 4f8b2cca..27cab19f 100644 --- a/src/httplib_prepare_cgi_environment.c +++ b/src/httplib_prepare_cgi_environment.c @@ -26,7 +26,6 @@ */ #include "httplib_main.h" -#include "httplib_memory.h" #include "httplib_ssl.h" #include "httplib_string.h" #include "httplib_utils.h" diff --git a/src/httplib_process_new_connection.c b/src/httplib_process_new_connection.c index 21d097d3..454b494c 100644 --- a/src/httplib_process_new_connection.c +++ b/src/httplib_process_new_connection.c @@ -26,7 +26,6 @@ */ #include "httplib_main.h" -#include "httplib_memory.h" #include "httplib_string.h" /* diff --git a/src/httplib_read_websocket.c b/src/httplib_read_websocket.c index 8a7c1e79..8c4f062a 100644 --- a/src/httplib_read_websocket.c +++ b/src/httplib_read_websocket.c @@ -26,7 +26,6 @@ */ #include "httplib_main.h" -#include "httplib_memory.h" /* * void XX_httplib_read_websocket( struct httplib_connection *conn, httplib_websocket_data_handler ws_data_handler, void *calback_data ); diff --git a/src/httplib_realloc2.c b/src/httplib_realloc2.c deleted file mode 100644 index 1208339e..00000000 --- a/src/httplib_realloc2.c +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) 2016 Lammert Bies - * Copyright (c) 2013-2016 the Civetweb developers - * Copyright (c) 2004-2013 Sergey Lyubka - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - * - * ============ - * Release: 2.0 - */ - -#include "httplib_main.h" -#include "httplib_memory.h" - -/* - * void *XX_httplib_realloc2( void *ptr, size_t size ); - * - * The function XX_httplib_realloc2() behaves like XX_httplib_realloc() with - * the difference that on failure the original buffer is released. - */ - -void *XX_httplib_realloc2( void *ptr, size_t size ) { - - void *new_ptr; - - new_ptr = httplib_realloc( ptr, size ); - if ( new_ptr == NULL ) httplib_free( ptr ); - - return new_ptr; - -} /* XX_httplib_realloc2 */ diff --git a/src/httplib_set_handler_type.c b/src/httplib_set_handler_type.c index 90c2f188..b97cdf40 100644 --- a/src/httplib_set_handler_type.c +++ b/src/httplib_set_handler_type.c @@ -26,7 +26,6 @@ */ #include "httplib_main.h" -#include "httplib_memory.h" #include "httplib_string.h" /* diff --git a/src/httplib_set_ports_option.c b/src/httplib_set_ports_option.c index f805d5f6..62d33b1e 100644 --- a/src/httplib_set_ports_option.c +++ b/src/httplib_set_ports_option.c @@ -26,7 +26,6 @@ */ #include "httplib_main.h" -#include "httplib_memory.h" #include "httplib_utils.h" static bool parse_port_string( const struct vec *vec, struct socket *so, int *ip_version ); diff --git a/src/httplib_ssl_get_client_cert_info.c b/src/httplib_ssl_get_client_cert_info.c index 5b1987c7..cc17d169 100644 --- a/src/httplib_ssl_get_client_cert_info.c +++ b/src/httplib_ssl_get_client_cert_info.c @@ -26,7 +26,6 @@ */ #include "httplib_main.h" -#include "httplib_memory.h" #include "httplib_ssl.h" #include "httplib_string.h" diff --git a/src/httplib_ssl_id_callback.c b/src/httplib_ssl_id_callback.c index 81f1c17c..c0b17d84 100644 --- a/src/httplib_ssl_id_callback.c +++ b/src/httplib_ssl_id_callback.c @@ -26,7 +26,6 @@ */ #include "httplib_main.h" -#include "httplib_memory.h" #include "httplib_pthread.h" #include "httplib_ssl.h" #include "httplib_utils.h" diff --git a/src/httplib_start.c b/src/httplib_start.c index cf8fcc58..e9dbb4a2 100644 --- a/src/httplib_start.c +++ b/src/httplib_start.c @@ -26,7 +26,6 @@ */ #include "httplib_main.h" -#include "httplib_memory.h" #include "httplib_pthread.h" #include "httplib_ssl.h" #include "httplib_string.h" diff --git a/src/httplib_strndup.c b/src/httplib_strndup.c index 3c22d07a..a6ea4130 100644 --- a/src/httplib_strndup.c +++ b/src/httplib_strndup.c @@ -23,7 +23,6 @@ */ #include "httplib_main.h" -#include "httplib_memory.h" /* * char *httplib_strndup( const char *str, size_t len ); diff --git a/src/httplib_tls_dtor.c b/src/httplib_tls_dtor.c index d338a387..41521a69 100644 --- a/src/httplib_tls_dtor.c +++ b/src/httplib_tls_dtor.c @@ -26,7 +26,6 @@ */ #include "httplib_main.h" -#include "httplib_memory.h" #include "httplib_pthread.h" #include "httplib_ssl.h" diff --git a/src/httplib_uninitialize_ssl.c b/src/httplib_uninitialize_ssl.c index da1c5b22..3801c31c 100644 --- a/src/httplib_uninitialize_ssl.c +++ b/src/httplib_uninitialize_ssl.c @@ -26,7 +26,6 @@ */ #include "httplib_main.h" -#include "httplib_memory.h" #include "httplib_pthread.h" #include "httplib_ssl.h" #include "httplib_utils.h" diff --git a/src/httplib_vprintf.c b/src/httplib_vprintf.c index 0366649d..1207c720 100644 --- a/src/httplib_vprintf.c +++ b/src/httplib_vprintf.c @@ -26,7 +26,6 @@ */ #include "httplib_main.h" -#include "httplib_memory.h" #include "httplib_string.h" /* diff --git a/src/httplib_websocket_client_thread.c b/src/httplib_websocket_client_thread.c index 0696be99..580a958d 100644 --- a/src/httplib_websocket_client_thread.c +++ b/src/httplib_websocket_client_thread.c @@ -26,7 +26,6 @@ */ #include "httplib_main.h" -#include "httplib_memory.h" /* * LIBHTTP_THREAD XX_httplib_websocket_client_thread( void *data ); diff --git a/src/httplib_websocket_client_write.c b/src/httplib_websocket_client_write.c index 0c8b1cd9..bc63f6ef 100644 --- a/src/httplib_websocket_client_write.c +++ b/src/httplib_websocket_client_write.c @@ -26,7 +26,6 @@ */ #include "httplib_main.h" -#include "httplib_memory.h" #include "httplib_utils.h" #if defined(USE_WEBSOCKET) diff --git a/src/httplib_worker_thread.c b/src/httplib_worker_thread.c index a51589bf..43961575 100644 --- a/src/httplib_worker_thread.c +++ b/src/httplib_worker_thread.c @@ -26,7 +26,6 @@ */ #include "httplib_main.h" -#include "httplib_memory.h" #include "httplib_pthread.h" #include "httplib_ssl.h" #include "httplib_utils.h"