(p []byte)
| 166 | } |
| 167 | |
| 168 | func (c *commandConn) Read(p []byte) (int, error) { |
| 169 | n, err := c.stdout.Read(p) |
| 170 | // check after the call to Read, since |
| 171 | // it is blocking, and while waiting on it |
| 172 | // Close might get called |
| 173 | if c.closing.Load() { |
| 174 | // If we're currently closing the connection |
| 175 | // we don't want to call onEOF |
| 176 | return n, err |
| 177 | } |
| 178 | |
| 179 | return n, c.handleEOF(err) |
| 180 | } |
| 181 | |
| 182 | func (c *commandConn) Write(p []byte) (int, error) { |
| 183 | n, err := c.stdin.Write(p) |