We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
问题描述如下: 我是用了auth plugin,但是每次断线重连之后在plugin这块都会直接返回connection close的error信息,跟踪代码后发现,在renewSessionForClient方法中,在p.pluginContainer.postDial(sess)时,当前session的状态依然是Closed,导致后续写消息直接判断状态返回了, 现修改如下:
renewSessionForClient
p.pluginContainer.postDial(sess)
func (p *peer) renewSessionForClient(sess *session, dialFunc func() (net.Conn, error), addr string, protoFuncs []ProtoFunc) error { var conn, dialErr = dialFunc() if dialErr != nil { return dialErr } if p.tlsConfig != nil { conn = tls.Client(conn, p.tlsConfig) } oldIP := sess.LocalAddr().String() oldID := sess.ID() oldConn := sess.getConn() if oldConn != nil { oldConn.Close() } sess.socket.Reset(conn, protoFuncs...) if oldIP == oldID { sess.socket.SetID(sess.LocalAddr().String()) } else { sess.socket.SetID(oldID) } atomic.StoreInt32(&sess.status, statusOk) //将状态修改放在plugin之前 if rerr := p.pluginContainer.postDial(sess); rerr != nil { sess.Close() return rerr.ToError() } // atomic.StoreInt32(&sess.status, statusOk) AnywayGo(sess.startReadAndHandle) p.sessHub.Set(sess) return nil }
不知道这样改动会不会引发其他问题,还没有完全吃透teleport的源码
The text was updated successfully, but these errors were encountered:
90cd90c
fix: #53
cd4418a
Change-Id: I8c740e6174e16bba19eba1f46767c9f0abb096e4
No branches or pull requests
问题描述如下:
我是用了auth plugin,但是每次断线重连之后在plugin这块都会直接返回connection close的error信息,跟踪代码后发现,在
renewSessionForClient
方法中,在p.pluginContainer.postDial(sess)
时,当前session的状态依然是Closed,导致后续写消息直接判断状态返回了,现修改如下:
不知道这样改动会不会引发其他问题,还没有完全吃透teleport的源码
The text was updated successfully, but these errors were encountered: