mirror of
https://github.com/XTLS/Xray-core.git
synced 2026-06-16 18:13:18 +00:00
Experiment: seed ignore buffer and send 1st fake packet instantly
This commit is contained in:
+7
-7
@@ -316,7 +316,7 @@ type VisionWriter struct {
|
||||
ob *session.Outbound
|
||||
|
||||
// internal
|
||||
writeOnceUserUUID []byte
|
||||
writeOnceUserUUID *[]byte
|
||||
directWriteCounter stats.Counter
|
||||
scheduler *Scheduler
|
||||
}
|
||||
@@ -329,11 +329,11 @@ func NewVisionWriter(writer buf.Writer, addon *Addons, trafficState *TrafficStat
|
||||
addons: addon,
|
||||
trafficState: trafficState,
|
||||
ctx: ctx,
|
||||
writeOnceUserUUID: w,
|
||||
writeOnceUserUUID: &w,
|
||||
isUplink: isUplink,
|
||||
conn: conn,
|
||||
ob: ob,
|
||||
scheduler: NewScheduler(writer, addon, trafficState, ctx),
|
||||
scheduler: NewScheduler(writer, addon, trafficState, &w, ctx),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -373,7 +373,7 @@ func (w *VisionWriter) WriteMultiBuffer(mb buf.MultiBuffer) error {
|
||||
|
||||
if *isPadding && ShouldStartSeed(w.addons, w.trafficState) {
|
||||
if len(mb) == 1 && mb[0] == nil {
|
||||
mb[0] = XtlsPadding(nil, CommandPaddingContinue, &w.writeOnceUserUUID, true, w.addons, w.ctx) // we do a long padding to hide vless header
|
||||
mb[0] = XtlsPadding(nil, CommandPaddingContinue, w.writeOnceUserUUID, true, w.addons, w.ctx) // we do a long padding to hide vless header
|
||||
} else {
|
||||
mb = ReshapeMultiBuffer(w.ctx, mb)
|
||||
longPadding := w.trafficState.IsTLS
|
||||
@@ -392,12 +392,12 @@ func (w *VisionWriter) WriteMultiBuffer(mb buf.MultiBuffer) error {
|
||||
*isPadding = false
|
||||
}
|
||||
}
|
||||
mb[i] = XtlsPadding(b, command, &w.writeOnceUserUUID, true, w.addons, w.ctx)
|
||||
mb[i] = XtlsPadding(b, command, w.writeOnceUserUUID, true, w.addons, w.ctx)
|
||||
longPadding = false
|
||||
continue
|
||||
} else if !w.trafficState.IsTLS12orAbove && ShouldStopSeed(w.addons, w.trafficState) {
|
||||
*isPadding = false
|
||||
mb[i] = XtlsPadding(b, CommandPaddingEnd, &w.writeOnceUserUUID, longPadding, w.addons, w.ctx)
|
||||
mb[i] = XtlsPadding(b, CommandPaddingEnd, w.writeOnceUserUUID, longPadding, w.addons, w.ctx)
|
||||
break
|
||||
}
|
||||
var command byte = CommandPaddingContinue
|
||||
@@ -407,7 +407,7 @@ func (w *VisionWriter) WriteMultiBuffer(mb buf.MultiBuffer) error {
|
||||
command = CommandPaddingDirect
|
||||
}
|
||||
}
|
||||
mb[i] = XtlsPadding(b, command, &w.writeOnceUserUUID, longPadding, w.addons, w.ctx)
|
||||
mb[i] = XtlsPadding(b, command, w.writeOnceUserUUID, longPadding, w.addons, w.ctx)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user