From cbe8c83195b25a23bc1c8a91a0ab3b028c61d6f9 Mon Sep 17 00:00:00 2001 From: Fufu Fang Date: Sat, 4 Sep 2021 03:15:26 +0100 Subject: [PATCH] stable version for master --- Makefile | 2 +- src/log.h | 2 +- src/ramcache.c | 22 +++++++++++----------- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/Makefile b/Makefile index d7aac7e..1906edf 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ VERSION = 1.2.3 -# -fsanitize=undefined -fanalyzer -Wno-analyzer-file-leak \ CFLAGS += -g -O2 -Wall -Wextra -Wshadow \ + -fsanitize=undefined -fanalyzer -Wno-analyzer-file-leak \ -rdynamic -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -DVERSION=\"$(VERSION)\"\ `pkg-config --cflags-only-I gumbo libcurl fuse uuid expat` LDFLAGS += `pkg-config --libs-only-L gumbo libcurl fuse uuid expat` diff --git a/src/log.h b/src/log.h index 3ea7b26..bd8a5d8 100644 --- a/src/log.h +++ b/src/log.h @@ -20,7 +20,7 @@ typedef enum { /** * \brief The default log level */ -#define DEFAULT_LOG_LEVEL fatal | error | warning | info | debug | cache_lock_debug +#define DEFAULT_LOG_LEVEL fatal | error | warning | info /** * \brief Get the log level from the environment. diff --git a/src/ramcache.c b/src/ramcache.c index 7c9a62f..e087621 100644 --- a/src/ramcache.c +++ b/src/ramcache.c @@ -11,12 +11,12 @@ size_t write_memory_callback(void *recv_data, size_t size, size_t nmemb, { size_t recv_size = size * nmemb; TransferStruct *ts = (TransferStruct *) userp; - - if (ts->bg_transfer) { - lprintf(ramcache_debug, "ramcache: thread %x: locking;\n", - pthread_self()); - } - PTHREAD_MUTEX_LOCK(&ts->lock); + // lprintf(ramcache_debug, "bg_transfer: %d\n", ts->bg_transfer); + // if (ts->bg_transfer) { + // lprintf(ramcache_debug, "ramcache: thread %x: locking;\n", + // pthread_self()); + // } + // PTHREAD_MUTEX_LOCK(&ts->lock); ts->data = realloc(ts->data, ts->curr_size + recv_size + 1); if (!ts->data) { @@ -29,11 +29,11 @@ size_t write_memory_callback(void *recv_data, size_t size, size_t nmemb, memmove(&ts->data[ts->curr_size], recv_data, recv_size); ts->curr_size += recv_size; ts->data[ts->curr_size] = '\0'; - if (ts->bg_transfer) { - lprintf(ramcache_debug, "ramcache: thread %x: unlocking;\n", - pthread_self()); - } - PTHREAD_MUTEX_UNLOCK(&ts->lock); + // if (ts->bg_transfer) { + // lprintf(ramcache_debug, "ramcache: thread %x: unlocking;\n", + // pthread_self()); + // } + // PTHREAD_MUTEX_UNLOCK(&ts->lock); return recv_size; }