From 5440febba42d0f46572d0617f0fdd5d2d38922de Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Wed, 8 Nov 2017 15:34:03 +0100 Subject: [SERVER] Add multiple config options for limiting stuff maxClients, maxImages, maxPayload, maxReplicationSize Refs #3231 --- src/server/globals.h | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'src/server/globals.h') diff --git a/src/server/globals.h b/src/server/globals.h index 1475981..c1d5d78 100644 --- a/src/server/globals.h +++ b/src/server/globals.h @@ -218,9 +218,38 @@ extern bool _lookupMissingForProxy; */ extern int _listenPort; +/** + * Max number of DNBD3 clients we accept + */ +extern int _maxClients; + +/** + * Max number of Images we support (in baseDir) + */ +extern int _maxImages; + +/** + * Maximum payload length we accept on uplinks and thus indirectly + * from clients in case the requested range is not cached locally. + * Usually this isn't even a megabyte for "real" clients (blockdev + * or fuse). + */ +extern int _maxPayload; + +/** + * If in proxy mode, don't replicate images that are + * larger than this according to the uplink server. + */ +extern uint64_t _maxReplicationSize; + /** * Load the server configuration. */ void globals_loadConfig(); +/** + * Dump the effective configuration in use to given buffer. + */ +size_t globals_dumpConfig(char *buffer, size_t size); + #endif /* GLOBALS_H_ */ -- cgit v1.2.3-55-g7522