• Andy Goldstein's avatar
    Port forwarding fixes · ed021fed
    Andy Goldstein authored
    Correct port-forward data copying logic so that the server closes its
    half of the data stream when socat exits, and the client closes its half
    of the data stream when it finishes writing.
    
    Modify the client to wait for both copies (client->server,
    server->client) to finish before it unblocks.
    
    Fix race condition in the Kubelet's handling of incoming port forward
    streams. Have the client generate a connectionID header to be used to
    associate the error and data streams for a single connection, instead of
    assuming that streams n and n+1 go together. Attempt to generate a
    pseudo connectionID in the server in the event the connectionID header
    isn't present (older clients); this is a best-effort approach that only
    really works with 1 connection at a time, whereas multiple concurrent
    connections will only work reliably with a newer client that is
    generating connectionID.
    ed021fed
server.go 34 KB