summaryrefslogtreecommitdiffstats
path: root/src/server/globals.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/globals.c')
-rw-r--r--src/server/globals.c6
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 );