mirror of
https://github.com/v2ray/v2ray-core.git
synced 2026-11-10 16:44:10 +00:00
refactor tcp worker
This commit is contained in:
10 files changed
+127
-238
No files matched your search
@@ -19,9 +19,12 @@ func ContextWithStreamSettings(ctx context.Context, streamSettings *StreamConfig
|
||||
return context.WithValue(ctx, streamSettingsKey, streamSettings)
|
||||
}
|
||||
|
||||
func StreamSettingsFromContext(ctx context.Context) (*StreamConfig, bool) {
|
||||
ss, ok := ctx.Value(streamSettingsKey).(*StreamConfig)
|
||||
return ss, ok
|
||||
func StreamSettingsFromContext(ctx context.Context) *StreamConfig {
|
||||
ss := ctx.Value(streamSettingsKey)
|
||||
if ss == nil {
|
||||
return nil
|
||||
}
|
||||
return ss.(*StreamConfig)
|
||||
}
|
||||
|
||||
func ContextWithDialerSource(ctx context.Context, addr net.Address) context.Context {
|
||||
|
||||
Reference in new issue
Block a user