go.crypto/ssh: add String method to RejectionReason.
R=agl, dave CC=golang-dev https://golang.org/cl/14494055
This commit is contained in:
committed by
Adam Langley
parent
7dc9a79b3e
commit
4a7557f2bd
@@ -77,6 +77,21 @@ const (
|
|||||||
ResourceShortage
|
ResourceShortage
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// String converts the rejection reason to human readable form.
|
||||||
|
func (r RejectionReason) String() string {
|
||||||
|
switch r {
|
||||||
|
case Prohibited:
|
||||||
|
return "administratively prohibited"
|
||||||
|
case ConnectionFailed:
|
||||||
|
return "connect failed"
|
||||||
|
case UnknownChannelType:
|
||||||
|
return "unknown channel type"
|
||||||
|
case ResourceShortage:
|
||||||
|
return "resource shortage"
|
||||||
|
}
|
||||||
|
return fmt.Sprintf("unknown reason %d", int(r))
|
||||||
|
}
|
||||||
|
|
||||||
type channel struct {
|
type channel struct {
|
||||||
packetConn // the underlying transport
|
packetConn // the underlying transport
|
||||||
localId, remoteId uint32
|
localId, remoteId uint32
|
||||||
|
|||||||
Reference in New Issue
Block a user