aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/github.com/gliderlabs/ssh/server.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/gliderlabs/ssh/server.go')
-rw-r--r--vendor/github.com/gliderlabs/ssh/server.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/vendor/github.com/gliderlabs/ssh/server.go b/vendor/github.com/gliderlabs/ssh/server.go
index 96b254d82f..be4355e4d7 100644
--- a/vendor/github.com/gliderlabs/ssh/server.go
+++ b/vendor/github.com/gliderlabs/ssh/server.go
@@ -48,6 +48,8 @@ type Server struct {
ServerConfigCallback ServerConfigCallback // callback for configuring detailed SSH options
SessionRequestCallback SessionRequestCallback // callback for allowing or denying SSH sessions
+ ConnectionFailedCallback ConnectionFailedCallback // callback to report connection failures
+
IdleTimeout time.Duration // connection timeout when no activity, none if empty
MaxTimeout time.Duration // absolute connection timeout, none if empty
@@ -278,7 +280,9 @@ func (srv *Server) HandleConn(newConn net.Conn) {
defer conn.Close()
sshConn, chans, reqs, err := gossh.NewServerConn(conn, srv.config(ctx))
if err != nil {
- // TODO: trigger event callback
+ if srv.ConnectionFailedCallback != nil {
+ srv.ConnectionFailedCallback(conn, err)
+ }
return
}