pico
created pr with
92.1
cmds
checkout latest patchset:
ssh pr.pico.sh print 92 | git am -3checkout any patchset in a patch request:
ssh pr.pico.sh print 92.[rev] | git am -3add changes to patch request:
git format-patch main --stdout | ssh pr.pico.sh pr add 92
Patchset
92.1
fix: tunnel leaks
Eric Bower
2025-12-16T04:10:10ZSemantic diff summary
1 added,
2 modified,
0 signature changed,
0 removed
across 2 analyzed files
(1 file skipped: unsupported file type)
+2
-0
.gitignore
#
+1
-1
pkg/apps/pgs/tunnel.go
#
| ... | ... | @@ -126,7 +126,7 @@ func CreateHttpHandler(cfg *PgsConfig) CtxHttpBridge { | |
| 126 | 126 | ||
| 127 | 127 | log.Info("user has access to site") | |
| 128 | 128 | ||
| 129 | - | routes := NewWebRouter(cfg) | |
| 129 | + | routes := newWebRouter(cfg) | |
| 130 | 130 | tunnelRouter := TunnelWebRouter{routes, subdomain} | |
| 131 | 131 | tunnelRouter.InitRouter() | |
| 132 | 132 | return &tunnelRouter |
+6
-1
pkg/apps/pgs/web.go
#
| ... | ... | @@ -107,13 +107,18 @@ type WebRouter struct { | |
| 107 | 107 | } | |
| 108 | 108 | ||
| 109 | 109 | func NewWebRouter(cfg *PgsConfig) *WebRouter { | |
| 110 | + | router := newWebRouter(cfg) | |
| 111 | + | go router.WatchCacheClear() | |
| 112 | + | return router | |
| 113 | + | } | |
| 114 | + | ||
| 115 | + | func newWebRouter(cfg *PgsConfig) *WebRouter { | |
| 110 | 116 | router := &WebRouter{ | |
| 111 | 117 | Cfg: cfg, | |
| 112 | 118 | RedirectsCache: expirable.NewLRU[string, []*RedirectRule](2048, nil, cache.CacheTimeout), | |
| 113 | 119 | HeadersCache: expirable.NewLRU[string, []*HeaderRule](2048, nil, cache.CacheTimeout), | |
| 114 | 120 | } | |
| 115 | 121 | router.initRouters() | |
| 116 | - | go router.WatchCacheClear() | |
| 117 | 122 | return router | |
| 118 | 123 | } | |
| 119 | 124 |