From 5f5603ce239dce08ae2ec4b0fa828787b220493c Mon Sep 17 00:00:00 2001 From: eunhhu Date: Thu, 1 Oct 2026 09:10:55 +0100 Subject: Deliver wires on the sending loop, a step at a time (017, 2b-2) A wire is now a sender of link/sending.h: its request goes on a non-blocking socket as far as the socket takes it (connect, TLS handshake, write, answer read), and its round waits for the socket or its deadline (10 s with nothing moved). The answer is read as it comes: the head whole, then a sized body counted down, a chunked one (few and small) parsed again as it grows, or a body to the close. The crypto table (version 6) takes the TLS handshake a step at a time, and reads and writes say what they wait for. The owner pushes a wire once a turn, as it does a link. A host whose app sends to ten links and ten wires has 5 threads where it had 24 (none: 3). --- link/crypto.c | 1 + 1 file changed, 1 insertion(+) (limited to 'link/crypto.c') diff --git a/link/crypto.c b/link/crypto.c index c8fb9bd..bec57c5 100644 --- a/link/crypto.c +++ b/link/crypto.c @@ -58,6 +58,7 @@ bool pure_tls_start(const char *ca_file, char *error, size_t size) { /* A session exists only once the table is loaded. */ PureTls *pure_tls_open(const char *host, int fd) { return crypto ? crypto->tls_open(host, fd) : NULL; } +int pure_tls_step(PureTls *tls) { return crypto->tls_step(tls); } int pure_tls_read(PureTls *tls, void *bytes, int size) { return crypto->tls_read(tls, bytes, size); } int pure_tls_write(PureTls *tls, const void *bytes, int size) { return crypto->tls_write(tls, bytes, size); } void pure_tls_close(PureTls *tls) { if (tls) crypto->tls_close(tls); } -- cgit v1.2.3