diff options
author | Simon Rettberg | 2017-08-26 16:24:07 +0200 |
---|---|---|
committer | Simon Rettberg | 2017-08-26 16:24:07 +0200 |
commit | 897615c6e926eefe2ef78dc7cc00fe633d2ab332 (patch) | |
tree | 60625ea05c0bda4a3a09286d91932d6bf5e52634 /src/server/globals.c | |
parent | [SERVER] Change handling of nonworking images, check for size change (diff) | |
download | dnbd3-897615c6e926eefe2ef78dc7cc00fe633d2ab332.tar.gz dnbd3-897615c6e926eefe2ef78dc7cc00fe633d2ab332.tar.xz dnbd3-897615c6e926eefe2ef78dc7cc00fe633d2ab332.zip |
[SERVER] Split server-only defs from config.h to serverconfig.h
Diffstat (limited to 'src/server/globals.c')
-rw-r--r-- | src/server/globals.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/server/globals.c b/src/server/globals.c index af4cfea..4939101 100644 --- a/src/server/globals.c +++ b/src/server/globals.c @@ -15,8 +15,9 @@ bool _isProxy = false; bool _proxyPrivateOnly = false; bool _backgroundReplication = true; int _listenPort = PORT; -int _uplinkTimeout = 1250; -int _clientTimeout = 15000; +int _uplinkTimeout = SOCKET_TIMEOUT_UPLINK; +int _clientTimeout = SOCKET_TIMEOUT_CLIENT; +bool _closeUnusedFd = 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) @@ -32,6 +33,7 @@ static int ini_handler(void *custom UNUSED, const char* section, const char* key SAVE_TO_VAR_BOOL( dnbd3, proxyPrivateOnly ); SAVE_TO_VAR_BOOL( dnbd3, backgroundReplication ); SAVE_TO_VAR_BOOL( dnbd3, removeMissingImages ); + SAVE_TO_VAR_BOOL( dnbd3, closeUnusedFd ); SAVE_TO_VAR_INT( dnbd3, serverPenalty ); SAVE_TO_VAR_INT( dnbd3, clientPenalty ); SAVE_TO_VAR_INT( dnbd3, uplinkTimeout ); |