crypto
crypto copied to clipboard
Update client.go
Client.NewSession方法仅仅返回了Session,而打开的channel通道却没有用武之地,且使用方无法获取到该通道,因为是私有属性,如果想要使用channel,需要再次调用openChanne()方法。本人进行服务器和交换机ssh远程登录时,使用到了该源码,服务器可以正常使用,但交换机只能一个Session一个Channel。本人添加NewSessionAndChannel()方法将Session中的channel及request一并返回,使用该channel与交换机及服务器都能正常通信。
This PR (HEAD: ae31a8bd46db90f4b0a6607db526dd28a13995ce) has been imported to Gerrit for code review.
Please visit https://go-review.googlesource.com/c/crypto/+/418680 to see it.
Tip: You can toggle comments from me using the comments slash command (e.g. /comments off)
See the Wiki page for more info
Message from Ian Lance Taylor:
Patch Set 1: Hold+1
(1 comment)
Please don’t reply on this GitHub thread. Visit golang.org/cl/418680. After addressing review feedback, remember to publish your drafts!
The Client.NewSession method only returns the Session, but the opened channel is useless, and the user cannot obtain the channel because it is a private property. If you want to use the channel, you need to call the openChanne() method again. When I log in to the server and the switch ssh remotely, I use this source code, the server can be used normally, but the switch can only have one Session and one Channel, and cannot open another channel again. I add the NewSessionAndChannel() method to return the channel and request in the Session together, and use the channel to communicate with the switch and the server normally.