stable version for master

This commit is contained in:
Fufu Fang 2021-09-04 03:15:26 +01:00
parent ebcfb0a79e
commit cbe8c83195
3 changed files with 13 additions and 13 deletions

View File

@ -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`

View File

@ -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.

View File

@ -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;
}