4 Commits

Author SHA1 Message Date
Zakk 833af7dc74 refactor: use what the dependencies already provide
A read of the tree for home-grown code that a dependency or the platform
covers. Each item names what replaces it.

- IPv4 CIDR membership was a binary-string trie (infra/dataStructure/trie)
  fed with CIDRs rendered as bit strings; net.IPNet.Contains, which the
  same file already used for IPv6, does it. The trie package is gone.
- The response replay cache was an LRU with its own linked list, indexes
  and timeout strategy (infra/dataStructure/lru), of which one fixed-size
  instance existed; hashicorp/golang-lru/v2, already in go.mod, is that
  cache, typed. go mod tidy also dropped go-nanoid, which nothing imported.
- The HTTP client for subscription updates through the local proxy carried
  a CONNECT dialer of its own (pkg/util/proxyWithHttp); http.Transport's
  Proxy handles socks5:// and http:// URLs, resolves hostnames on the
  SOCKS proxy and uses CONNECT for https. Verified on the VM: a
  subscription update succeeds in both "pac" and "proxy" modes.
- core/dns/qtype.go listed nine type names in two switches before falling
  back to miekg/dns tables that contain the same names; dns.Type.String
  and dns.StringToType are the tables.
- The GUI tracked prefers-color-scheme with its own media query and
  toggled a theme-dark class nothing reads any more; Vuetify's "system"
  theme follows the OS itself. Verified in headless Chrome: auto follows
  the OS in both directions, an explicit choice overrides it.
- The AUR packages carried .INSTALL hooks whose only content was a
  coloured "Completed!" banner, duplicated in the deb/rpm after-install
  scripts; pacman and apt report that themselves. The hooks are gone, the
  release workflow stops copying them, and after_install/after_upgrade
  keep only daemon-reload and the restart.
- The tap release job downloaded eight artifacts in eight steps;
  actions/download-artifact takes a pattern with merge-multiple.
2026-09-20 16:40:34 +10:00
Zakk b232abde47 fix(reqCache): a request id's lock is dropped once its last user leaves
The map gained one mutex per request id and never shrank; the GUI sends
a fresh id per request.
2026-09-19 22:04:12 +10:00
Zakk 262c56009e fix(service): guard crashes and silent data loss found in the sweep
- time.Ticker.Reset panics on a non-positive duration; a stored auto-update
  interval of 0 crashed every start (pre_update.go) and every settings
  save. Route both tickers through configure.IntervalHours, which falls
  back to one hour.
- The auto-updater indexes a startup snapshot; a subscription deleted
  while it runs panicked out of range in a goroutine and took the daemon
  down. UpdateSubscription now refuses an index that no longer exists.
- ResolveSubscriptionWithClient applied its 30 s timeout floor to a copy
  it never used, accepted HTTP error pages as an empty node list, and
  returned zero nodes without error, so UpdateSubscription replaced the
  stored list with nothing on a provider 403/5xx. Use the copy, reject
  status >= 400 and empty results.
- PutOutbound wrote an error response and then fell through to the
  success response, producing two JSON bodies.
- TestHttpLatency passed nil entries (servers it could not locate) to
  addHosts, which dereferenced them; skip them.
- ReqCache read the per-request mutex map after releasing the lock that
  guards writes to it (a fatal concurrent map access under load).
- The websocket writer ran one goroutine per message box on a single
  gorilla connection, which forbids concurrent writes; serialize them.
2026-09-18 02:53:31 +10:00
mzz2017 0d16bd32a7 feat: organize project structure, change log package to beego log and remove v2ray/log package 2021-08-27 14:09:08 +08:00