mirror of
https://github.com/netbirdio/netbird.git
synced 2026-09-12 17:59:06 +02:00
File drop needs a local filesystem to deliver into and a receiver it can bind, so wasm supports neither and never sets a manager. The code still linked in, because the Engine reached filedrop through an untagged field, and with it the net/http server and client. That put the wasm binary 0.97MiB over the 60MB budget, on a main that had 0.34MiB of headroom left. Split the feature on the js tag: the logic file and the OS dialer become !js, a js no-op carries the start, stop and rebind entry points the engine calls on its lifecycle paths, and a build-tagged alias types the manager so engine.go and connect.go stay untagged and lose the import. iOS keeps the full feature: the logic file is !js and the iOS dialer stays behind the ios tag. Drops the wasm binary to 59.89MiB, with no filedrop symbol left in it.
19 lines
298 B
Go
19 lines
298 B
Go
//go:build !ios && !js
|
|
|
|
package internal
|
|
|
|
import (
|
|
"net"
|
|
|
|
"github.com/netbirdio/netbird/client/internal/filedrop"
|
|
)
|
|
|
|
func fileDropOSDial(WGIface) filedrop.DialFunc {
|
|
dialer := &net.Dialer{}
|
|
return dialer.DialContext
|
|
}
|
|
|
|
func fileDropListenControl(WGIface) filedrop.ListenControl {
|
|
return nil
|
|
}
|