mirror of
https://github.com/XTLS/Xray-core.git
synced 2025-04-29 16:58:34 +00:00
Add Timer to Inbound metadata struct
This commit is contained in:
parent
5a43fa750d
commit
41beb4ec04
4 changed files with 22 additions and 6 deletions
|
@ -103,7 +103,8 @@ func (d *DokodemoDoor) Process(ctx context.Context, network net.Network, conn in
|
|||
return newError("unable to get destination")
|
||||
}
|
||||
|
||||
if inbound := session.InboundFromContext(ctx); inbound != nil {
|
||||
inbound := session.InboundFromContext(ctx)
|
||||
if inbound != nil {
|
||||
inbound.User = &protocol.MemoryUser{
|
||||
Level: d.config.UserLevel,
|
||||
}
|
||||
|
@ -121,6 +122,10 @@ func (d *DokodemoDoor) Process(ctx context.Context, network net.Network, conn in
|
|||
ctx, cancel := context.WithCancel(ctx)
|
||||
timer := signal.CancelAfterInactivity(ctx, cancel, plcy.Timeouts.ConnectionIdle)
|
||||
|
||||
if inbound != nil {
|
||||
inbound.Timer = timer
|
||||
}
|
||||
|
||||
ctx = policy.ContextWithBufferPolicy(ctx, plcy.Buffer)
|
||||
link, err := dispatcher.Dispatch(ctx, dest)
|
||||
if err != nil {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue