From 921a1b80fd86197ee2fd93b5394a3810a31b51a3 Mon Sep 17 00:00:00 2001 From: Lammert Bies Date: Wed, 16 Nov 2016 02:06:45 +0100 Subject: [PATCH] Fixed split issues --- Makefile | 2 +- src/handle_form.inl | 2 +- src/httplib_start.c | 20 ++++++++++---------- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Makefile b/Makefile index b621717e..5c9b1ee0 100644 --- a/Makefile +++ b/Makefile @@ -65,7 +65,7 @@ BUILD_DIRS += $(BUILD_DIR)/test endif # only set main compile options if none were chosen -CFLAGS += -Wall -Wextra -Wshadow -Wformat-security -Winit-self -Wmissing-prototypes -D$(TARGET_OS) -Iinclude $(COPT) -DUSE_STACK_SIZE=102400 +CFLAGS += -Wall -Wextra -Werror -Wshadow -Wformat-security -Winit-self -Wmissing-prototypes -D$(TARGET_OS) -Iinclude $(COPT) -DUSE_STACK_SIZE=102400 LIBS = -lpthread -lm diff --git a/src/handle_form.inl b/src/handle_form.inl index 8913456c..689b1114 100644 --- a/src/handle_form.inl +++ b/src/handle_form.inl @@ -90,7 +90,7 @@ url_encoded_field_get(const struct mg_connection *conn, { char key_dec[1024]; - char *value_dec = mg_malloc(value_len + 1); + char *value_dec = XX_httplib_malloc(value_len + 1); int value_dec_len, ret; if (!value_dec) { diff --git a/src/httplib_start.c b/src/httplib_start.c index 7df5d682..9a975b8e 100644 --- a/src/httplib_start.c +++ b/src/httplib_start.c @@ -70,7 +70,7 @@ struct mg_context *mg_start( const struct mg_callbacks *callbacks, void *user_da pthread_mutexattr_settype(&pthread_mutex_attr, PTHREAD_MUTEX_RECURSIVE); #endif - if (0 != pthread_key_create(&sTlsKey, tls_dtor)) { + if (0 != pthread_key_create(&sTlsKey, XX_httplib_tls_dtor)) { /* Fatal error - abort start. However, this situation should * never * occur in practice. */ @@ -160,19 +160,19 @@ struct mg_context *mg_start( const struct mg_callbacks *callbacks, void *user_da } #endif - get_system_name(&ctx->systemName); + XX_httplib_get_system_name(&ctx->systemName); /* NOTE(lsm): order is important here. SSL certificates must * be initialized before listening ports. UID must be set last. */ - if (!set_gpass_option(ctx) || + if (!XX_httplib_set_gpass_option(ctx) || #if !defined(NO_SSL) - !set_ssl_option(ctx) || + !XX_httplib_set_ssl_option(ctx) || #endif - !set_ports_option(ctx) || + !XX_httplib_set_ports_option(ctx) || #if !defined(_WIN32) - !set_uid_option(ctx) || + !XX_httplib_set_uid_option(ctx) || #endif - !set_acl_option(ctx)) { + !XX_httplib_set_acl_option(ctx)) { free_context(ctx); pthread_setspecific(sTlsKey, NULL); return NULL; @@ -253,19 +253,19 @@ struct mg_context *mg_start( const struct mg_callbacks *callbacks, void *user_da ctx->context_type = 1; /* server context */ /* Start master (listening) thread */ - mg_start_thread_with_id(master_thread, ctx, &ctx->masterthreadid); + mg_start_thread_with_id( XX_httplib_master_thread, ctx, &ctx->masterthreadid); /* Start worker threads */ for (i = 0; i < ctx->cfg_worker_threads; i++) { struct worker_thread_args *wta = - mg_malloc(sizeof(struct worker_thread_args)); + XX_httplib_malloc(sizeof(struct worker_thread_args)); if (wta) { wta->ctx = ctx; wta->index = (int)i; } if ((wta == NULL) - || (mg_start_thread_with_id(worker_thread, + || (XX_httplib_mg_start_thread_with_id(XX_httplib_worker_thread, wta, &ctx->workerthreadids[i]) != 0)) {