diff options
author | Uros Majstorovic <majstor@majstor.org> | 2024-05-23 00:42:25 +0200 |
---|---|---|
committer | Uros Majstorovic <majstor@majstor.org> | 2024-05-23 00:42:25 +0200 |
commit | 9c8ae2d28f0c3e75371fbae6e9f688798b44255c (patch) | |
tree | 12d62040b51ac9fbd86fd0259bf4e5f46b2ad801 /ecp/server/dir.c | |
parent | ea2bfa175c9fcc4c0d4aa708fea6ce497b2c73d6 (diff) |
added multiple server receiver threads; added server dir query
Diffstat (limited to 'ecp/server/dir.c')
-rw-r--r-- | ecp/server/dir.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/ecp/server/dir.c b/ecp/server/dir.c index 95db4b5..c045599 100644 --- a/ecp/server/dir.c +++ b/ecp/server/dir.c @@ -428,7 +428,7 @@ void dir_process_item(ECPDirItem *dir_item, ECPSocket *sock, ecp_ecdh_public_t * pthread_mutex_lock(&node->mutex); pthread_rwlock_unlock(&dir_shadow_rwlock); - if (node->zombie) goto process_item_fin; + if (node->zombie || (s_public == NULL)) goto process_item_fin; if (!node->verified) { int key_ex = 0; @@ -754,6 +754,19 @@ void dit_init_serial(uint16_t serial) { } } +int dir_init_dir_cnt(unsigned int dir_cnt, uint16_t serial) { + int rv = ECP_OK; + + if (dir_online) { + pthread_rwlock_wrlock(&dir_online_rwlock); + if (dir_online->serial != serial) rv = ECP_ERR; + if (!rv) dir_vkey_req = dir_cnt / 2 + 1; + pthread_rwlock_unlock(&dir_online_rwlock); + } + + return rv; +} + void dir_announce(ECPSocket *sock, int ann_period) { struct hashtable_itr itr; DIRNode *node; |