From 6f7054df1825807b225fc654fc26172fa95162ae Mon Sep 17 00:00:00 2001 From: "roberto@debian32" Date: Thu, 18 Aug 2011 14:27:21 +0200 Subject: [PATCH] more tolerant cache and queue size --- cache.c | 2 +- queue.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cache.c b/cache.c index ee31aaa4..82b5cb5b 100644 --- a/cache.c +++ b/cache.c @@ -8,7 +8,7 @@ void uwsgi_init_cache() { if (!uwsgi.cache_blocksize) uwsgi.cache_blocksize = UMAX16; - if (uwsgi.cache_blocksize % uwsgi.page_size != 0) { + if ((uwsgi.cache_blocksize * uwsgi.cache_max_items) % uwsgi.page_size != 0) { uwsgi_log("invalid cache blocksize %llu: must be a multiple of memory page size (%d bytes)\n", (unsigned long long) uwsgi.cache_blocksize, uwsgi.page_size); exit(1); } diff --git a/queue.c b/queue.c index a2a2216d..3040b402 100644 --- a/queue.c +++ b/queue.c @@ -6,8 +6,8 @@ void uwsgi_init_queue() { if (!uwsgi.queue_blocksize) uwsgi.queue_blocksize = 8192; - if (uwsgi.queue_blocksize % uwsgi.page_size != 0) { - uwsgi_log("invalid queue blocksize %llu: must be a multiple of memory page size (%d bytes)\n", (unsigned long long) uwsgi.queue_blocksize, uwsgi.page_size); + if ((uwsgi.queue_blocksize * uwsgi.queue_size) % uwsgi.page_size != 0) { + uwsgi_log("invalid queue size/blocksize %llu: must be a multiple of memory page size (%d bytes)\n", (unsigned long long) uwsgi.queue_blocksize, uwsgi.page_size); exit(1); }