mirror of
https://github.com/shazow/ssh-chat.git
synced 2025-04-12 15:17:16 +03:00
sshd, chat/message: Add more debug logging for close failures
This commit is contained in:
parent
3848014d41
commit
7a783d46af
@ -143,7 +143,9 @@ func (u *User) setColorIdx(idx int) {
|
||||
func (u *User) Close() {
|
||||
u.closeOnce.Do(func() {
|
||||
if u.screen != nil {
|
||||
u.screen.Close()
|
||||
if err := u.screen.Close(); err != nil {
|
||||
logger.Printf("Failed to close user %q screen: %s", u.ID(), err)
|
||||
}
|
||||
}
|
||||
// close(u.msg) TODO: Close?
|
||||
close(u.done)
|
||||
|
@ -167,7 +167,9 @@ func (t *Terminal) Close() error {
|
||||
var err error
|
||||
t.closeOnce.Do(func() {
|
||||
close(t.done)
|
||||
t.Channel.Close()
|
||||
if err := t.Channel.Close(); err != nil {
|
||||
logger.Printf("[%s] Failed to close terminal channel: %s", t.Conn.RemoteAddr(), err)
|
||||
}
|
||||
err = t.Conn.Close()
|
||||
})
|
||||
return err
|
||||
|
Loading…
x
Reference in New Issue
Block a user