mirror of
https://github.com/fatedier/frp.git
synced 2026-05-15 16:15:49 -06:00
[PR #5218] [MERGED] server/control: deduplicate close-proxy logic and UserInfo construction #5183
Labels
No labels
In Progress
WIP
WaitingForInfo
bug
doc
duplicate
easy
enhancement
future
help wanted
invalid
lifecycle/stale
need-issue-template
need-usage-help
no plan
proposal
pull-request
question
todo
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: github-starred/frp#5183
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/fatedier/frp/pull/5218
Author: @fatedier
Created: 3/7/2026
Status: ✅ Merged
Merged: 3/7/2026
Merged by: @fatedier
Base:
dev← Head:new📝 Commits (1)
8bb5ba9server/control: deduplicate close-proxy logic and UserInfo construction📊 Changes
1 file changed (+32 additions, -47 deletions)
View changed files
📝
server/control.go(+32 -47)📄 Description
Summary
closeProxy()helper to eliminate duplicated 4-step cleanup sequence (Close,PxyManager.Del, metrics report, plugin notify) betweenworker()andCloseProxy()loginUserInfo()helper to eliminate 4 repeatedplugin.UserInfoconstructions usingLoginMsgfieldsworker()to snapshot and clear the proxies map under lock, then perform cleanup outside the lock to reduce lock hold timeChanges
Single file:
server/control.go(+32, -47)Test plan
go build ./server/...passesgolangci-lint run ./server/...— 0 issuesgo test ./server/... ./pkg/...— all pass🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.