summaryrefslogtreecommitdiffstats
path: root/src/server/globals.c
diff options
context:
space:
mode:
authorSimon Rettberg2013-08-28 17:54:19 +0200
committerSimon Rettberg2013-08-28 17:54:19 +0200
commitbfdac5b274d8ca371307d2b4b417092ba25f11ab (patch)
treec62b57b0d56995057f152f1e1273dc3383a709a1 /src/server/globals.c
parent[SERVER] On-the-fly transparent proxying (diff)
downloaddnbd3-bfdac5b274d8ca371307d2b4b417092ba25f11ab.tar.gz
dnbd3-bfdac5b274d8ca371307d2b4b417092ba25f11ab.tar.xz
dnbd3-bfdac5b274d8ca371307d2b4b417092ba25f11ab.zip
[SERVER] Copy CRC-32 list from uplink server if available
Split up helper.c, move file/disk related functions to fileutil.c Uplink: Make sure relayed requests are at least 1MiB
Diffstat (limited to 'src/server/globals.c')
-rw-r--r--src/server/globals.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/server/globals.c b/src/server/globals.c
index 1e23fb3..ac3f279 100644
--- a/src/server/globals.c
+++ b/src/server/globals.c
@@ -12,6 +12,7 @@ int _vmdkLegacyMode = FALSE;
int _shutdown = 0;
int _serverPenalty = 0;
int _clientPenalty = 0;
+int _isProxy = FALSE;
#define SAVE_TO_VAR_STR(ss, kk) do { if (strcmp(section, #ss) == 0 && strcmp(key, #kk) == 0) { if (_ ## kk != NULL) free(_ ## kk); _ ## kk = strdup(value); } } while (0)
#define SAVE_TO_VAR_BOOL(ss, kk) do { if (strcmp(section, #ss) == 0 && strcmp(key, #kk) == 0) _ ## kk = atoi(value) != 0 || strcmp(value, "true") == 0 || strcmp(value, "True") == 0 || strcmp(value, "TRUE") == 0; } while (0)
@@ -19,8 +20,9 @@ int _clientPenalty = 0;
static int ini_handler(void *custom, const char* section, const char* key, const char* value)
{
- SAVE_TO_VAR_STR( dnbd3, basePath );
+ if ( _basePath == NULL ) SAVE_TO_VAR_STR( dnbd3, basePath );
SAVE_TO_VAR_BOOL( dnbd3, vmdkLegacyMode );
+ SAVE_TO_VAR_BOOL( dnbd3, isProxy );
SAVE_TO_VAR_INT( dnbd3, serverPenalty );
SAVE_TO_VAR_INT( dnbd3, clientPenalty );
return TRUE;