connection: Carry an explicit flag through rather than fiddling with buffers and peeking