(conn streamCreator)
| 83 | } |
| 84 | |
| 85 | func (p *streamProtocolV3) stream(conn streamCreator) error { |
| 86 | if err := p.createStreams(conn); err != nil { |
| 87 | return err |
| 88 | } |
| 89 | |
| 90 | // now that all the streams have been created, proceed with reading & copying |
| 91 | |
| 92 | errorChan := watchErrorStream(p.errorStream, &errorDecoderV3{}) |
| 93 | |
| 94 | p.handleResizes() |
| 95 | |
| 96 | p.copyStdin() |
| 97 | |
| 98 | var wg sync.WaitGroup |
| 99 | p.copyStdout(&wg) |
| 100 | p.copyStderr(&wg) |
| 101 | |
| 102 | // we're waiting for stdout/stderr to finish copying |
| 103 | wg.Wait() |
| 104 | |
| 105 | // waits for errorStream to finish reading with an error or nil |
| 106 | return <-errorChan |
| 107 | } |
| 108 | |
| 109 | type errorDecoderV3 struct { |
| 110 | errorDecoderV2 |
nothing calls this directly
no test coverage detected