[PR #5217] [MERGED] server: introduce SessionContext to encapsulate NewControl parameters #5182

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

📋 Pull Request Information

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

Base: devHead: new


📝 Commits (1)

  • c5aa7e3 server: introduce SessionContext to encapsulate NewControl parameters

📊 Changes

2 files changed (+103 additions, -111 deletions)

View changed files

📝 server/control.go (+86 -103)
📝 server/service.go (+17 -8)

📄 Description

Summary

  • Introduce SessionContext struct in server/control.go to bundle the 10 positional parameters of NewControl() into a single struct, matching the client-side pattern (client/control.go:SessionContext)
  • Eliminate post-construction mutation of clientRegistry (previously assigned at service.go:629 after NewControl returned)
  • Remove two TODO comments (server/control.go:158, server/service.go:607)

Test plan

  • make build passes
  • make test passes
  • golangci-lint run ./server/... — 0 issues
  • go vet ./server/... passes
  • Codex review confirms no functional regression

🔄 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/5217 **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) - [`c5aa7e3`](https://github.com/fatedier/frp/commit/c5aa7e3e07bb1e258166b4414a2c8a7f9638ef53) server: introduce SessionContext to encapsulate NewControl parameters ### 📊 Changes **2 files changed** (+103 additions, -111 deletions) <details> <summary>View changed files</summary> 📝 `server/control.go` (+86 -103) 📝 `server/service.go` (+17 -8) </details> ### 📄 Description ## Summary - Introduce `SessionContext` struct in `server/control.go` to bundle the 10 positional parameters of `NewControl()` into a single struct, matching the client-side pattern (`client/control.go:SessionContext`) - Eliminate post-construction mutation of `clientRegistry` (previously assigned at `service.go:629` after `NewControl` returned) - Remove two TODO comments (`server/control.go:158`, `server/service.go:607`) ## Test plan - [x] `make build` passes - [x] `make test` passes - [x] `golangci-lint run ./server/...` — 0 issues - [x] `go vet ./server/...` passes - [x] Codex review confirms no functional regression --- <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:14 -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#5182
No description provided.