This repository was archived by the owner on May 6, 2024. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -18,12 +18,18 @@ import (
1818 "errors"
1919 "log"
2020 "os"
21+ "runtime/debug"
2122
2223 "github.com/Jigsaw-Code/outline-go-tun2socks/tunnel"
2324)
2425
2526const vpnMtu = 1500
2627
28+ func init () {
29+ // Conserve memory by increasing garbage collection frequency.
30+ debug .SetGCPercent (10 )
31+ }
32+
2733func makeTunFile (fd int ) (* os.File , error ) {
2834 if fd < 0 {
2935 return nil , errors .New ("Must provide a valid TUN file descriptor" )
Original file line number Diff line number Diff line change @@ -62,7 +62,7 @@ func (t *outlinetunnel) SetUDPEnabled(isUDPEnabled bool) {
6262 return
6363 }
6464 t .isUDPEnabled = isUDPEnabled
65- t .lwipStack .Close () // Close exisiting connections to avoid using the previous handlers.
65+ t .lwipStack .Close () // Close existing connections to avoid using the previous handlers.
6666 t .registerConnectionHandlers ()
6767}
6868
You can’t perform that action at this time.
0 commit comments