chiark / gitweb /
privcache: Break out DEFAULT_MAXPRIV_BYTES
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 7 Dec 2019 16:31:08 +0000 (16:31 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 15 Feb 2020 21:56:54 +0000 (21:56 +0000)
We're going to reuse this.

No functional change.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
privcache.c

index ba5ddc903a0ee4e5fdb4be83d18236bb45048938..719a2d0da72e2f5b3fd0674814719bb6bf41c0bf 100644 (file)
@@ -21,6 +21,7 @@
 #include "util.h"
 
 #define DEFAULT_SIZE 5
+#define DEFAULT_MAXPRIV_BYTES 4095
 
 struct ent {
     struct sigkeyid id;
@@ -207,7 +208,7 @@ static list_t *privcache_apply(closure_t *self, struct cloc loc,
     st->used=0;
 
     int32_t buflen=dict_read_number(dict,"privkey-max",False,"privcache",loc,
-                                   4095);
+                                   DEFAULT_MAXPRIV_BYTES);
     buffer_new(&st->databuf,buflen+1);
 
     const char *path=dict_read_string(dict,"privkeys",True,"privcache",loc);