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()
if streamSettings.DownloadSettings == nil {
streamSettings.DownloadSettings = common.Must2(internet.ToMemoryStreamConfig(transportConfiguration.DownloadSettings)).(*internet.MemoryStreamConfig)
if streamSettings.DownloadSettings.SocketSettings == nil {
streamSettings.DownloadSettings.SocketSettings = streamSettings.SocketSettings
}
}
globalDialerAccess.Unlock()
memory2 := streamSettings.DownloadSettings