refactor(forwarder): remove CreateForwardedTCPIPPayload method
SonarQube Scan / SonarQube Trigger (push) Successful in 2m32s

- OpenForwardedChannel now privately calls CreateForwardedTCPIPPayload
- Removed an unused function
This commit is contained in:
2026-01-25 20:49:12 +07:00
parent 21b551a66d
commit f1d20905d0
6 changed files with 20 additions and 54 deletions
+1 -2
View File
@@ -152,10 +152,9 @@ func (hh *httpHandler) handlePingRequest(slug string, conn net.Conn) bool {
}
func (hh *httpHandler) forwardRequest(hw stream.HTTP, initialRequest header.RequestHeader, sshSession registry.Session) {
payload := sshSession.Forwarder().CreateForwardedTCPIPPayload(hw.RemoteAddr())
ctx, cancel := context.WithTimeout(context.Background(), time.Second*5)
defer cancel()
channel, reqs, err := sshSession.Forwarder().OpenForwardedChannel(ctx, payload)
channel, reqs, err := sshSession.Forwarder().OpenForwardedChannel(ctx, hw.RemoteAddr())
if err != nil {
log.Printf("Failed to open forwarded-tcpip channel: %v", err)
return