diff options
author | Simon Rettberg | 2019-07-23 17:21:29 +0200 |
---|---|---|
committer | Simon Rettberg | 2019-07-23 17:24:27 +0200 |
commit | a61b4f18a1f9dcb78dba4bcde48a9318b04a45ec (patch) | |
tree | efcd06d888729bc60b53bcd9864e4c97b700010f /src/server/globals.c | |
parent | [SERVER] uplink: Relay request in client's thread if possible (diff) | |
download | dnbd3-a61b4f18a1f9dcb78dba4bcde48a9318b04a45ec.tar.gz dnbd3-a61b4f18a1f9dcb78dba4bcde48a9318b04a45ec.tar.xz dnbd3-a61b4f18a1f9dcb78dba4bcde48a9318b04a45ec.zip |
[SERVER] Add pretendClient config option
This makes the server not set the FLAGS8_SERVER flag
when establishing an uplink connection. Useful mostly
for running a proxy on localhost for local caching.
Diffstat (limited to 'src/server/globals.c')
-rw-r--r-- | src/server/globals.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/server/globals.c b/src/server/globals.c index c9b9411..010274d 100644 --- a/src/server/globals.c +++ b/src/server/globals.c @@ -32,6 +32,7 @@ atomic_int _maxClients = SERVER_MAX_CLIENTS; atomic_int _maxImages = SERVER_MAX_IMAGES; atomic_int _maxPayload = 9000000; // 9MB atomic_uint_fast64_t _maxReplicationSize = (uint64_t)100000000000LL; +atomic_bool _pretendClient = false; /** * True when loading config the first time. Consecutive loads will @@ -80,6 +81,7 @@ static int ini_handler(void *custom UNUSED, const char* section, const char* key SAVE_TO_VAR_UINT( dnbd3, clientTimeout ); SAVE_TO_VAR_UINT( limits, maxPayload ); SAVE_TO_VAR_UINT64( limits, maxReplicationSize ); + SAVE_TO_VAR_BOOL( dnbd3, pretendClient ); if ( strcmp( section, "dnbd3" ) == 0 && strcmp( key, "backgroundReplication" ) == 0 ) { if ( strcmp( value, "hashblock" ) == 0 ) { _backgroundReplication = BGR_HASHBLOCK; |