Browse Source

Add comm_init() function

pull/439/head
francesco_carli 4 years ago
committed by GitHub
parent
commit
b5d4a70983
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      src/sn.c

5
src/sn.c

@ -45,6 +45,7 @@ static int load_allowed_sn_community(n2n_sn_t *sss, char *path) {
} }
HASH_ITER(hh, sss->communities, s, tmp) { HASH_ITER(hh, sss->communities, s, tmp) {
if(s->is_federation) continue;
HASH_DEL(sss->communities, s); HASH_DEL(sss->communities, s);
if (NULL != s->header_encryption_ctx) if (NULL != s->header_encryption_ctx)
free (s->header_encryption_ctx); free (s->header_encryption_ctx);
@ -89,11 +90,9 @@ static int load_allowed_sn_community(n2n_sn_t *sss, char *path) {
} }
} }
s = (struct sn_community*)calloc(1,sizeof(struct sn_community)); comm_init(s,cmn_str);
if(s != NULL) { if(s != NULL) {
strncpy((char*)s->community, cmn_str, N2N_COMMUNITY_SIZE-1);
s->community[N2N_COMMUNITY_SIZE-1] = '\0';
/* loaded from file, this community is unpurgeable */ /* loaded from file, this community is unpurgeable */
s->purgeable = COMMUNITY_UNPURGEABLE; s->purgeable = COMMUNITY_UNPURGEABLE;
/* we do not know if header encryption is used in this community, /* we do not know if header encryption is used in this community,

Loading…
Cancel
Save