Panic when running on old GoTTY server
moul opened this issue · 0 comments
moul commented
$ ./gotty-client http://localhost:8081/
500 Internal Server Error
panic: runtime error: index out of range
goroutine 1 [running]:
github.com/moul/gotty-client.(*Client).GetAuthToken(0xc820014e10, 0x0, 0x0, 0x0, 0x0)
/Users/moul/go/src/github.com/moul/gotty-client/gotty-client.go:116 +0x4f5
github.com/moul/gotty-client.(*Client).Connect(0xc820014e10, 0x0, 0x0)
/Users/moul/go/src/github.com/moul/gotty-client/gotty-client.go:122 +0x45
github.com/moul/gotty-client.(*Client).Loop(0xc820014e10, 0x0, 0x0)
/Users/moul/go/src/github.com/moul/gotty-client/gotty-client.go:180 +0x3a
main.Action(0xc8200aa000)
/Users/moul/go/src/github.com/moul/gotty-client/cmd/gotty-client/main.go:41 +0x3a6
github.com/codegangsta/cli.(*App).Run(0xc8200a8200, 0xc82000a2c0, 0x2, 0x2, 0x0, 0x0)
/Users/moul/go/src/github.com/codegangsta/cli/app.go:164 +0xc81
main.main()
/Users/moul/go/src/github.com/moul/gotty-client/cmd/gotty-client/main.go:24 +0x12e
goroutine 17 [syscall, locked to thread]:
runtime.goexit()
/usr/local/Cellar/go/1.5.1/libexec/src/runtime/asm_amd64.s:1696 +0x1
goroutine 5 [syscall]:
os/signal.loop()
/usr/local/Cellar/go/1.5.1/libexec/src/os/signal/signal_unix.go:22 +0x18
created by os/signal.init.1
/usr/local/Cellar/go/1.5.1/libexec/src/os/signal/signal_unix.go:28 +0x37
goroutine 9 [IO wait]:
net.runtime_pollWait(0x1365698, 0x72, 0xc82000e230)
/usr/local/Cellar/go/1.5.1/libexec/src/runtime/netpoll.go:157 +0x60
net.(*pollDesc).Wait(0xc8200601b0, 0x72, 0x0, 0x0)
/usr/local/Cellar/go/1.5.1/libexec/src/net/fd_poll_runtime.go:73 +0x3a
net.(*pollDesc).WaitRead(0xc8200601b0, 0x0, 0x0)
/usr/local/Cellar/go/1.5.1/libexec/src/net/fd_poll_runtime.go:78 +0x36
net.(*netFD).Read(0xc820060150, 0xc820019000, 0x1000, 0x1000, 0x0, 0x1360050, 0xc82000e230)
/usr/local/Cellar/go/1.5.1/libexec/src/net/fd_unix.go:232 +0x23a
net.(*conn).Read(0xc82002c050, 0xc820019000, 0x1000, 0x1000, 0x0, 0x0, 0x0)
/usr/local/Cellar/go/1.5.1/libexec/src/net/net.go:172 +0xe4
net/http.noteEOFReader.Read(0x1365758, 0xc82002c050, 0xc820012108, 0xc820019000, 0x1000, 0x1000, 0x0, 0x0, 0x0)
/usr/local/Cellar/go/1.5.1/libexec/src/net/http/transport.go:1370 +0x67
net/http.(*noteEOFReader).Read(0xc82000aa80, 0xc820019000, 0x1000, 0x1000, 0x0, 0x0, 0x0)
<autogenerated>:126 +0xd0
bufio.(*Reader).fill(0xc82001a5a0)
/usr/local/Cellar/go/1.5.1/libexec/src/bufio/bufio.go:97 +0x1e9
bufio.(*Reader).Peek(0xc82001a5a0, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0)
/usr/local/Cellar/go/1.5.1/libexec/src/bufio/bufio.go:132 +0xcc
net/http.(*persistConn).readLoop(0xc8200120b0)
/usr/local/Cellar/go/1.5.1/libexec/src/net/http/transport.go:876 +0xf7
created by net/http.(*Transport).dialConn
/usr/local/Cellar/go/1.5.1/libexec/src/net/http/transport.go:685 +0xc78
goroutine 10 [select]:
net/http.(*persistConn).writeLoop(0xc8200120b0)
/usr/local/Cellar/go/1.5.1/libexec/src/net/http/transport.go:1009 +0x40c
created by net/http.(*Transport).dialConn
/usr/local/Cellar/go/1.5.1/libexec/src/net/http/transport.go:686 +0xc9d
make: *** [test] Error 2