Problem
Parsent.close() records terminal state for the current transport, but HIO has no explicit inverse operation for a newly opened transport generation. The HTTP Client therefore opens a fresh socket without consistently replacing and resetting the old response parser:
Client.reopen() delegates only to the connector.
- automatic reconnect calls
connector.reopen() directly.
- cross-origin redirect replaces and opens the connector, then only calls
Respondent.reinit().
The old parser object and its terminal facts can survive across sockets. Today parseMessage() happens to clear some of those facts when it is advanced, but that implicit behavior makes later EOF handling unsafe: EOF cannot become monotonic within one parser generation until opening a new generation explicitly clears it.
Expected behavior
Add a parser-level reopen() operation that resets terminal parsing facts and creates a new parser. Invoke it only after a connector successfully opens a new socket through manual reopen, automatic reconnect, or cross-origin redirect replacement.
Acceptance tests
Use real HIO Clients, Servers, accepted connections, and sockets to prove:
- parser terminal facts reset and the parser object is replaced;
- manual Client reopen closes the old socket and rearms parsing;
- a real peer cutoff followed by timer-driven reconnect rearms parsing; and
- a real cross-origin connector replacement closes the old socket, opens the target connector, and rearms parsing.
Scope
This issue preserves existing reconnect ordering. It does not clear receive bytes, reject an active manual reopen, interpret EOF, or settle the old response before reconnect. Those are separate dependent changes.
This behavior is generic to HIO and is immediately upstreamable.
Problem
Parsent.close()records terminal state for the current transport, but HIO has no explicit inverse operation for a newly opened transport generation. The HTTPClienttherefore opens a fresh socket without consistently replacing and resetting the old response parser:Client.reopen()delegates only to the connector.connector.reopen()directly.Respondent.reinit().The old parser object and its terminal facts can survive across sockets. Today
parseMessage()happens to clear some of those facts when it is advanced, but that implicit behavior makes later EOF handling unsafe: EOF cannot become monotonic within one parser generation until opening a new generation explicitly clears it.Expected behavior
Add a parser-level
reopen()operation that resets terminal parsing facts and creates a new parser. Invoke it only after a connector successfully opens a new socket through manual reopen, automatic reconnect, or cross-origin redirect replacement.Acceptance tests
Use real HIO Clients, Servers, accepted connections, and sockets to prove:
Scope
This issue preserves existing reconnect ordering. It does not clear receive bytes, reject an active manual reopen, interpret EOF, or settle the old response before reconnect. Those are separate dependent changes.
This behavior is generic to HIO and is immediately upstreamable.