X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=comm-common.c;h=48041cd8e2fb857a6643165487522673bb093484;hb=9eba4abfe44617aa78f625d900fe6bc2c58bb4cb;hp=7528e924ced75647ad3c6f537b43486fe54d1bd6;hpb=b7886fd46ab05c97b8a072e497903622bd1d5290;p=secnet.git diff --git a/comm-common.c b/comm-common.c index 7528e92..48041cd 100644 --- a/comm-common.c +++ b/comm-common.c @@ -1,7 +1,31 @@ +/* + * This file is part of secnet. + * See README for full list of copyright holders. + * + * secnet is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * secnet is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * version 3 along with secnet; if not, see + * https://www.gnu.org/licenses/gpl.html. + */ #include "secnet.h" #include "comm-common.h" +struct comm_clientinfo *comm_clientinfo_ignore(void *state, dict_t *dict, + struct cloc cloc) +{ + return 0; +} + void comm_request_notify(void *commst, void *nst, comm_notify_fn *fn) { struct commcommon *st=commst; @@ -27,13 +51,16 @@ void comm_release_notify(void *commst, void *nst, comm_notify_fn *fn) } } -bool_t comm_notify(struct comm_notify_list *notify, +bool_t comm_notify(struct commcommon *cc, struct buffer_if *buf, const struct comm_addr *ca) { + struct comm_notify_list *notify = &cc->notify; struct comm_notify_entry *n; + priomsg_reset(&cc->why_unwanted); + LIST_FOREACH(n, notify, entry) { - if (n->fn(n->state, buf, ca)) { + if (n->fn(n->state, buf, ca, &cc->why_unwanted)) { return True; } } @@ -51,4 +78,5 @@ void comm_apply(struct commcommon *cc, void *st) cc->ops.release_notify=comm_release_notify; LIST_INIT(&cc->notify); cc->rbuf=NULL; + priomsg_new(&cc->why_unwanted, MAX_NAK_MSG); }