• Gustav Paul's avatar
    exp/ssh: Have Wait() return an *ExitError · 50c24bf6
    Gustav Paul authored
    I added the clientChan's msg channel to the list of channels that are closed in mainloop when the server sends a channelCloseMsg.
    
    I added an ExitError type that wraps a Waitmsg similar to that of os/exec. I fill ExitStatus with the data returned in the 'exit-status' channel message and Msg with the data returned in the 'exit-signal' channel message.
    
    Instead of having Wait() return on the first 'exit-status'/'exit-signal' I have it return an ExitError containing the status and signal when the clientChan's msg channel is closed.
    
    I added two tests cases to session_test.go that test for exit status 0 (in which case Wait() returns nil) and exit status 1 (in which case Wait() returns an ExitError with ExitStatus 1)
    
    R=dave, agl, rsc, golang-dev, bradfitz
    CC=golang-dev
    https://golang.org/cl/5452051
    50c24bf6
Name
Last commit
Last update
..
Makefile Loading commit data...
channel.go Loading commit data...
cipher.go Loading commit data...
cipher_test.go Loading commit data...
client.go Loading commit data...
client_auth.go Loading commit data...
client_auth_test.go Loading commit data...
client_func_test.go Loading commit data...
common.go Loading commit data...
common_test.go Loading commit data...
doc.go Loading commit data...
messages.go Loading commit data...
messages_test.go Loading commit data...
server.go Loading commit data...
server_shell.go Loading commit data...
server_shell_test.go Loading commit data...
session.go Loading commit data...
session_test.go Loading commit data...
tcpip.go Loading commit data...
tcpip_func_test.go Loading commit data...
transport.go Loading commit data...
transport_test.go Loading commit data...