mirror of
https://github.com/tailscale/tailscale.git
synced 2026-07-29 08:46:33 -04:00
The session recording WebSocket parser rejected frames whose extended payload length field had not fully arrived yet, tearing down 'kubectl exec' sessions whenever a read from the network delivered only the first two or three bytes of a frame header. Every data frame carrying 126 or more bytes of payload uses an extended length field, so bulk stdin (such as piping a file into a pod through the API server proxy) failed with near-certainty on large transfers, while small interactive sessions were rarely affected. Teach fragmentDimensions to report an incomplete frame header distinctly, so that both the data and control frame paths buffer and wait for more bytes instead of erroring out and killing the session. Add tests covering both extended length forms and control frames being split at every boundary within the frame header, into two and three segments, on both the read (client to server) and write (server to client) paths, plus a bulk stdin passthrough test approximating how 'kubectl exec' frames and chunks a large stdin stream. Updates tailscale/corp#39583 Change-Id: I9c28a17bc6bee898abfa2af2519c99fff9144217 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>