mirror of
https://github.com/shadowsocks/shadowsocks-libev.git
synced 2026-10-21 22:43:48 +00:00
Make parameters of bloom filter be compiler-time constants
This commit is contained in:
+2
-2
@@ -111,9 +111,9 @@ crypto_init(const char *password, const char *key, const char *method)
|
||||
|
||||
// Initialize NONCE bloom filter
|
||||
#ifdef MODULE_REMOTE
|
||||
ppbloom_init(1000000, 0.00001);
|
||||
ppbloom_init(NUM_NONCE_ENTRIES_FOR_SERVER, ERROR_RATE_FOR_SERVER);
|
||||
#else
|
||||
ppbloom_init(100000, 0.0000001);
|
||||
ppbloom_init(NUM_NONCE_ENTRIES_FOR_CLIENT, ERROR_RATE_FOR_CLIENT);
|
||||
#endif
|
||||
|
||||
if (method != NULL) {
|
||||
|
||||
@@ -66,6 +66,22 @@ typedef mbedtls_md_info_t digest_type_t;
|
||||
#define SUBKEY_INFO "ss-subkey"
|
||||
#define IV_INFO "ss-iv"
|
||||
|
||||
#ifndef NUM_NONCE_ENTRIES_FOR_CLIENT
|
||||
#define NUM_NONCE_ENTRIES_FOR_SERVER 1e6
|
||||
#endif
|
||||
|
||||
#ifndef NUM_NONCE_ENTRIES_FOR_CLIENT
|
||||
#define NUM_NONCE_ENTRIES_FOR_CLIENT 1e4
|
||||
#endif
|
||||
|
||||
#ifndef ERROR_RATE_FOR_SERVER
|
||||
#define ERROR_RATE_FOR_SERVER 1e-6
|
||||
#endif
|
||||
|
||||
#ifndef ERROR_RATE_FOR_CLIENT
|
||||
#define ERROR_RATE_FOR_CLIENT 1e-15
|
||||
#endif
|
||||
|
||||
typedef struct buffer {
|
||||
size_t idx;
|
||||
size_t len;
|
||||
|
||||
Reference in New Issue
Block a user