From a06b652768a8643fe76efdc80a0c6eb729268fc5 Mon Sep 17 00:00:00 2001 From: eunhhu Date: Tue, 29 Sep 2026 16:42:45 +0100 Subject: Say why a stream is refused (REFUSED), and try it again seldom A receiver that took no records of a stream (a source the key may not send as, no input of that name, an input of another shape) said nothing: its sender heard them acknowledged, never stored, and sent them all again every second, for ever, and its operator saw nothing. Now the receiver answers REFUSED (0x0c: the names, and why), and the sender sends no records for a second, then a packet of them to learn whether they are taken now, the wait twice as long each time (64 s at most). A refusal ends when that packet is acknowledged with no REFUSED beside, or a record is stored. link.c says it once on stderr, as a wire says a receiver does not take its sends; serve's input says which of the two the app lacks. test-link: each of the three is refused seven times in 90 s with nine packets, and a stream refused until the app has its input goes on then, all 200 records stored. check.py links a node to an input its receiver lacks: said once, two packets in 2.5 s. --- serve/serve.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'serve') diff --git a/serve/serve.c b/serve/serve.c index 969bf89..b271d14 100644 --- a/serve/serve.c +++ b/serve/serve.c @@ -2339,10 +2339,8 @@ static void stop_shard(Host *host) { static int link_input(void *context, const char *name, uint32_t shape) { const PureModule *m = ((Owner *)context)->executor.app.module; int index = pure_module_input(m, name); - if (index < 0 || m->input[index].kind != PURE_KIND_MESSAGE || m->input[index].keyed || - pure_module_shape(m, (uint32_t)index) != shape) - return -1; - return index; + if (index < 0 || m->input[index].kind != PURE_KIND_MESSAGE || m->input[index].keyed) return -PURE_LINK_NO_INPUT; + return pure_module_shape(m, (uint32_t)index) == shape ? index : -PURE_LINK_OTHER_SHAPE; } /* Records a link delivered, queued at the owner as a request is: applied -- cgit v1.2.3