[PR #5219] [MERGED] client/visitor: deduplicate visitor connection handshake and wrapping #5184

Closed
opened 2026-05-05 14:56:18 -06:00 by gitea-mirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/fatedier/frp/pull/5219
Author: @fatedier
Created: 3/7/2026
Status: Merged
Merged: 3/7/2026
Merged by: @fatedier

Base: devHead: new


📝 Commits (1)

  • f948c59 client/visitor: deduplicate visitor connection handshake and wrapping

📊 Changes

4 files changed (+87 additions, -120 deletions)

View changed files

📝 client/visitor/stcp.go (+5 -53)
📝 client/visitor/sudp.go (+13 -53)
📝 client/visitor/visitor.go (+62 -0)
📝 client/visitor/xtcp.go (+7 -14)

📄 Description

Summary

  • Extract dialRawVisitorConn on BaseVisitor to deduplicate the connect + NewVisitorConn handshake (auth, sign key, 10s deadline, error check) shared by STCP and SUDP
  • Extract wrapVisitorConn package-level helper to deduplicate encryption + pooled compression wrapping shared by all three visitor types (STCP, SUDP, XTCP)
  • Upgrade SUDP from WithCompression to WithCompressionFromPool, aligning with STCP/XTCP pooled compression

Net change: +87, -120 lines (33 lines saved)

Test plan

  • go build passes
  • go vet passes
  • golangci-lint run — 0 issues
  • make test — all unit tests pass

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/fatedier/frp/pull/5219 **Author:** [@fatedier](https://github.com/fatedier) **Created:** 3/7/2026 **Status:** ✅ Merged **Merged:** 3/7/2026 **Merged by:** [@fatedier](https://github.com/fatedier) **Base:** `dev` ← **Head:** `new` --- ### 📝 Commits (1) - [`f948c59`](https://github.com/fatedier/frp/commit/f948c595f48624f791c534067773b7aa0c92b319) client/visitor: deduplicate visitor connection handshake and wrapping ### 📊 Changes **4 files changed** (+87 additions, -120 deletions) <details> <summary>View changed files</summary> 📝 `client/visitor/stcp.go` (+5 -53) 📝 `client/visitor/sudp.go` (+13 -53) 📝 `client/visitor/visitor.go` (+62 -0) 📝 `client/visitor/xtcp.go` (+7 -14) </details> ### 📄 Description ## Summary - Extract `dialRawVisitorConn` on `BaseVisitor` to deduplicate the connect + NewVisitorConn handshake (auth, sign key, 10s deadline, error check) shared by STCP and SUDP - Extract `wrapVisitorConn` package-level helper to deduplicate encryption + pooled compression wrapping shared by all three visitor types (STCP, SUDP, XTCP) - Upgrade SUDP from `WithCompression` to `WithCompressionFromPool`, aligning with STCP/XTCP pooled compression Net change: +87, -120 lines (33 lines saved) ## Test plan - [x] `go build` passes - [x] `go vet` passes - [x] `golangci-lint run` — 0 issues - [x] `make test` — all unit tests pass --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
gitea-mirror 2026-05-05 14:56:18 -06:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/frp#5184
No description provided.