XHTTP downloadSettings: Inherit sockopt if its own doesn't exist (e.g., in extra)

If you want `downloadSettings` to use its own `sockopt`, make sure that `extra` doesn't exist.
This commit is contained in:
RPRX 2024-12-18 11:22:29 +00:00 committed by GitHub
parent 96fb680d45
commit 9dbdf92c27
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -308,6 +308,9 @@ func Dial(ctx context.Context, dest net.Destination, streamSettings *internet.Me
globalDialerAccess.Lock() globalDialerAccess.Lock()
if streamSettings.DownloadSettings == nil { if streamSettings.DownloadSettings == nil {
streamSettings.DownloadSettings = common.Must2(internet.ToMemoryStreamConfig(transportConfiguration.DownloadSettings)).(*internet.MemoryStreamConfig) streamSettings.DownloadSettings = common.Must2(internet.ToMemoryStreamConfig(transportConfiguration.DownloadSettings)).(*internet.MemoryStreamConfig)
if streamSettings.DownloadSettings.SocketSettings == nil {
streamSettings.DownloadSettings.SocketSettings = streamSettings.SocketSettings
}
} }
globalDialerAccess.Unlock() globalDialerAccess.Unlock()
memory2 := streamSettings.DownloadSettings memory2 := streamSettings.DownloadSettings