fix: stop parliament accept starvation on outbound dial (0.9.22)
Peer dial used per-step read timeouts so a stuck handshake could block the single-threaded daemon for tens of seconds; inbound hellos piled up unread (CLOSE-WAIT). Use a wall-clock dial budget, drain accepts before each dial, skip self, and only one side initiates idle polls. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -24,6 +24,7 @@ typedef struct {
|
||||
} cst_peer_session_t;
|
||||
|
||||
/* Dial host:port, prove our cert, verify theirs, establish AEAD session.
|
||||
* timeout_ms is a wall-clock budget for connect+handshake+kx (not per-read).
|
||||
* Leaves sock open for post-handshake sync; call cst_peer_close. */
|
||||
int cst_peer_dial(const char *host, int port, const cst_realm_cert_t *self,
|
||||
const uint8_t self_sk[64], const uint8_t realm_pk[32],
|
||||
|
||||
Reference in New Issue
Block a user