mirror of
https://github.com/v2fly/v2ray-core.git
synced 2026-05-15 00:49:15 -04:00
handle status keep alive
This commit is contained in:
@@ -295,6 +295,16 @@ func (m *Client) fetchOutput() {
|
||||
log.Trace(newError("failed to read metadata").Base(err))
|
||||
break
|
||||
}
|
||||
if meta.SessionStatus == SessionStatusKeepAlive {
|
||||
if meta.Option.Has(OptionData) {
|
||||
if err := drain(reader); err != nil {
|
||||
log.Trace(newError("failed to read data").Base(err))
|
||||
break
|
||||
}
|
||||
}
|
||||
continue
|
||||
}
|
||||
|
||||
m.access.RLock()
|
||||
s, found := m.sessions[meta.SessionID]
|
||||
m.access.RUnlock()
|
||||
@@ -390,6 +400,16 @@ func (w *ServerWorker) run(ctx context.Context) {
|
||||
return
|
||||
}
|
||||
|
||||
if meta.SessionStatus == SessionStatusKeepAlive {
|
||||
if meta.Option.Has(OptionData) {
|
||||
if err := drain(reader); err != nil {
|
||||
log.Trace(newError("failed to read data").Base(err))
|
||||
break
|
||||
}
|
||||
}
|
||||
continue
|
||||
}
|
||||
|
||||
w.access.RLock()
|
||||
s, found := w.sessions[meta.SessionID]
|
||||
w.access.RUnlock()
|
||||
|
||||
Reference in New Issue
Block a user