mirror of
https://github.com/storytold/gridcraft.git
synced 2026-10-30 21:56:53 -06:00
authenticate() set the read timeout on the writing half of the socket while it read the token through a try_clone; on Windows the clone has its own timeout, so a peer that never sent a line held its thread forever (and a per-read timeout let a byte-at-a-time peer stretch it elsewhere). The first line now has one total deadline, set on the handle being read and shortened before each read. At most 16 connections may wait to authenticate (more are closed on accept, as #2174 suggested), and accept errors back off instead of spinning. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>