From: Mark Wooding Date: Mon, 20 Sep 2021 20:10:23 +0000 (+0100) Subject: server/peer.c: Add a flags argument to `p_txend'. X-Git-Url: https://git.distorted.org.uk/~mdw/tripe/commitdiff_plain/aa1a02116adb4d83635cd891842ba8f899d59565 server/peer.c: Add a flags argument to `p_txend'. --- diff --git a/server/keyexch.c b/server/keyexch.c index b1411004..bea5051e 100644 --- a/server/keyexch.c +++ b/server/keyexch.c @@ -622,7 +622,7 @@ static void kxc_answer(keyexch *kx, kxchal *kxc) if (BOK(b)) { update_stats_tx(kx, BLEN(b)); - p_txend(kx->p); + p_txend(kx->p, 0); } /* --- Schedule another resend --- */ @@ -775,7 +775,7 @@ static int dotoken(keyexch *kx, buf *b) if (BBAD(bbb)) return (-1); update_stats_tx(kx, BLEN(bbb)); - p_txend(kx->p); + p_txend(kx->p, 0); return (0); } @@ -820,7 +820,7 @@ static int doprechallenge(keyexch *kx, buf *b) sendchallenge(kx, b, C, GH_DONE(h, 0)); GH_DESTROY(h); update_stats_tx(kx, BLEN(b)); - p_txend(kx->p); + p_txend(kx->p, 0); /* --- Done --- */ @@ -1166,7 +1166,7 @@ static void resend(keyexch *kx) if (BOK(b)) { update_stats_tx(kx, BLEN(b)); - p_txend(kx->p); + p_txend(kx->p, 0); } if (kx->s < KXS_SWITCH) { diff --git a/server/peer.c b/server/peer.c index dab3bfcf..bc90b32b 100644 --- a/server/peer.c +++ b/server/peer.c @@ -430,7 +430,7 @@ static void p_read(int fd, unsigned mode, void *v) if (!p) goto unexp; p_rxupdstats(p, n); buf_put(p_txstart(p, MSG_MISC | MISC_PONG), BCUR(&b), BLEFT(&b)); - p_txend(p); + p_txend(p, 0); break; case MISC_PONG: if (!p) goto unexp; @@ -445,7 +445,7 @@ static void p_read(int fd, unsigned mode, void *v) buf_flip(&bb); p_encrypt(p, MSG_MISC | MISC_EPONG, &bb, p_txstart(p, MSG_MISC | MISC_EPONG)); - p_txend(p); + p_txend(p, 0); } break; case MISC_EPONG: @@ -533,6 +533,7 @@ int p_txaddr(const addr *a, const void *p, size_t sz) /* --- @p_txend@ --- * * * Arguments: @peer *p@ = pointer to peer block + * @unsigned f@ = flags * * Returns: --- * @@ -562,7 +563,7 @@ static int p_dotxend(peer *p) } } -void p_txend(peer *p) +void p_txend(peer *p, unsigned f) { if (p_dotxend(p) && p->spec.t_ka) { sel_rmtimer(&p->tka); @@ -656,7 +657,7 @@ int p_pingsend(peer *p, ping *pg, unsigned type, pg->msg = MISC_PONG; b = p_txstart(p, MSG_MISC | MISC_PING); p_pingwrite(pg, b); - p_txend(p); + p_txend(p, 0); break; case MISC_EPING: pg->msg = MISC_EPONG; @@ -667,7 +668,7 @@ int p_pingsend(peer *p, ping *pg, unsigned type, p_encrypt(p, MSG_MISC | MISC_EPING, &bb, b); if (!BOK(b)) return (-1); - p_txend(p); + p_txend(p, 0); break; default: abort(); @@ -704,7 +705,7 @@ void p_greet(peer *p, const void *c, size_t sz) { buf *b = p_txstart(p, MSG_MISC | MISC_GREET); buf_put(b, c, sz); - p_txend(p); + p_txend(p, 0); } /* --- @p_tun@ --- * @@ -726,7 +727,7 @@ void p_tun(peer *p, buf *b) if (BOK(bb) && BLEN(bb)) { p->st.n_ipout++; p->st.sz_ipout += BLEN(bb); - p_txend(p); + p_txend(p, 0); } } @@ -1242,7 +1243,7 @@ void p_destroy(peer *p, int bye) buf_init(&bb, buf_t, sizeof(buf_t)); assert(BOK(&bb)); buf_flip(&bb); p_encrypt(p, MSG_MISC | MISC_BYE, &bb, b); - p_txend(p); + p_txend(p, 0); } a_notify("KILL", "%s", p->spec.name, A_END); diff --git a/server/tripe.h b/server/tripe.h index ea980c6b..a304e3ef 100644 --- a/server/tripe.h +++ b/server/tripe.h @@ -1580,13 +1580,14 @@ extern int p_txaddr(const addr */*a*/, const void */*p*/, size_t /*sz*/); /* --- @p_txend@ --- * * * Arguments: @peer *p@ = pointer to peer block + * @unsigned f@ = flags * * Returns: --- * * Use: Sends a packet to the peer. */ -extern void p_txend(peer */*p*/); +extern void p_txend(peer */*p*/, unsigned /*f*/); /* --- @p_pingsend@ --- * *