mirror of
https://github.com/lammertb/libhttp.git
synced 2025-08-12 01:22:40 +03:00
Fixed split issues
This commit is contained in:
2
Makefile
2
Makefile
@@ -65,7 +65,7 @@ BUILD_DIRS += $(BUILD_DIR)/test
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
# only set main compile options if none were chosen
|
# 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
|
LIBS = -lpthread -lm
|
||||||
|
|
||||||
|
@@ -90,7 +90,7 @@ url_encoded_field_get(const struct mg_connection *conn,
|
|||||||
{
|
{
|
||||||
char key_dec[1024];
|
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;
|
int value_dec_len, ret;
|
||||||
|
|
||||||
if (!value_dec) {
|
if (!value_dec) {
|
||||||
|
@@ -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);
|
pthread_mutexattr_settype(&pthread_mutex_attr, PTHREAD_MUTEX_RECURSIVE);
|
||||||
#endif
|
#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
|
/* Fatal error - abort start. However, this situation should
|
||||||
* never
|
* never
|
||||||
* occur in practice. */
|
* occur in practice. */
|
||||||
@@ -160,19 +160,19 @@ struct mg_context *mg_start( const struct mg_callbacks *callbacks, void *user_da
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
get_system_name(&ctx->systemName);
|
XX_httplib_get_system_name(&ctx->systemName);
|
||||||
|
|
||||||
/* NOTE(lsm): order is important here. SSL certificates must
|
/* NOTE(lsm): order is important here. SSL certificates must
|
||||||
* be initialized before listening ports. UID must be set last. */
|
* 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)
|
#if !defined(NO_SSL)
|
||||||
!set_ssl_option(ctx) ||
|
!XX_httplib_set_ssl_option(ctx) ||
|
||||||
#endif
|
#endif
|
||||||
!set_ports_option(ctx) ||
|
!XX_httplib_set_ports_option(ctx) ||
|
||||||
#if !defined(_WIN32)
|
#if !defined(_WIN32)
|
||||||
!set_uid_option(ctx) ||
|
!XX_httplib_set_uid_option(ctx) ||
|
||||||
#endif
|
#endif
|
||||||
!set_acl_option(ctx)) {
|
!XX_httplib_set_acl_option(ctx)) {
|
||||||
free_context(ctx);
|
free_context(ctx);
|
||||||
pthread_setspecific(sTlsKey, NULL);
|
pthread_setspecific(sTlsKey, NULL);
|
||||||
return 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 */
|
ctx->context_type = 1; /* server context */
|
||||||
|
|
||||||
/* Start master (listening) thread */
|
/* 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 */
|
/* Start worker threads */
|
||||||
for (i = 0; i < ctx->cfg_worker_threads; i++) {
|
for (i = 0; i < ctx->cfg_worker_threads; i++) {
|
||||||
struct worker_thread_args *wta =
|
struct worker_thread_args *wta =
|
||||||
mg_malloc(sizeof(struct worker_thread_args));
|
XX_httplib_malloc(sizeof(struct worker_thread_args));
|
||||||
if (wta) {
|
if (wta) {
|
||||||
wta->ctx = ctx;
|
wta->ctx = ctx;
|
||||||
wta->index = (int)i;
|
wta->index = (int)i;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((wta == NULL)
|
if ((wta == NULL)
|
||||||
|| (mg_start_thread_with_id(worker_thread,
|
|| (XX_httplib_mg_start_thread_with_id(XX_httplib_worker_thread,
|
||||||
wta,
|
wta,
|
||||||
&ctx->workerthreadids[i]) != 0)) {
|
&ctx->workerthreadids[i]) != 0)) {
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user