server/peer.c: Add a flags argument to `p_txend'.
authorMark Wooding <mdw@distorted.org.uk>
Mon, 20 Sep 2021 20:10:23 +0000 (21:10 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Sat, 30 Apr 2022 00:51:38 +0000 (01:51 +0100)
server/keyexch.c
server/peer.c
server/tripe.h

index b141100..bea5051 100644 (file)
@@ -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) {
index dab3bfc..bc90b32 100644 (file)
@@ -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);
index ea980c6..a304e3e 100644 (file)
@@ -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@ --- *
  *