watchtower/wtserver/server: print connFailure error code name
This commit is contained in:
parent
ec6e2010d6
commit
590f5811e8
@ -142,6 +142,6 @@ func (s *Server) replyCreateSession(peer Peer, id *wtdb.SessionID,
|
|||||||
// disconnect the client.
|
// disconnect the client.
|
||||||
return &connFailure{
|
return &connFailure{
|
||||||
ID: *id,
|
ID: *id,
|
||||||
Code: uint16(code),
|
Code: code,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -52,6 +52,6 @@ func (s *Server) replyDeleteSession(peer Peer, id *wtdb.SessionID,
|
|||||||
// disconnect the client.
|
// disconnect the client.
|
||||||
return &connFailure{
|
return &connFailure{
|
||||||
ID: *id,
|
ID: *id,
|
||||||
Code: uint16(code),
|
Code: code,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -283,12 +283,12 @@ func (s *Server) handleClient(peer Peer) {
|
|||||||
// error code.
|
// error code.
|
||||||
type connFailure struct {
|
type connFailure struct {
|
||||||
ID wtdb.SessionID
|
ID wtdb.SessionID
|
||||||
Code uint16
|
Code wtwire.ErrorCode
|
||||||
}
|
}
|
||||||
|
|
||||||
// Error displays the SessionID and Code that caused the connection failure.
|
// Error displays the SessionID and Code that caused the connection failure.
|
||||||
func (f *connFailure) Error() string {
|
func (f *connFailure) Error() string {
|
||||||
return fmt.Sprintf("connection with %s failed with code=%v",
|
return fmt.Sprintf("connection with %s failed with code=%s",
|
||||||
f.ID, f.Code,
|
f.ID, f.Code,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -117,7 +117,7 @@ func (s *Server) handleStateUpdate(peer Peer, id *wtdb.SessionID,
|
|||||||
if s.cfg.NoAckUpdates {
|
if s.cfg.NoAckUpdates {
|
||||||
return &connFailure{
|
return &connFailure{
|
||||||
ID: *id,
|
ID: *id,
|
||||||
Code: uint16(failCode),
|
Code: failCode,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -152,6 +152,6 @@ func (s *Server) replyStateUpdate(peer Peer, id *wtdb.SessionID,
|
|||||||
// disconnect the client.
|
// disconnect the client.
|
||||||
return &connFailure{
|
return &connFailure{
|
||||||
ID: *id,
|
ID: *id,
|
||||||
Code: uint16(code),
|
Code: code,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user