mirror of
https://github.com/XTLS/Xray-core.git
synced 2026-07-02 17:58:46 +00:00
Revert to original buffer processing order (input then rawInput)
Per RPRX's clarification, the original order was correct. Reverted the buffer processing order back to: input → rawInput. The issue is not an ordering problem as I misunderstood. Awaiting clarification on the actual fix needed. Co-authored-by: RPRX <63339210+RPRX@users.noreply.github.com>
This commit is contained in:
+8
-17
@@ -257,25 +257,16 @@ func (w *VisionReader) ReadMultiBuffer() (buf.MultiBuffer, error) {
|
|||||||
|
|
||||||
if *switchToDirectCopy {
|
if *switchToDirectCopy {
|
||||||
// XTLS Vision processes TLS-like conn's input and rawInput
|
// XTLS Vision processes TLS-like conn's input and rawInput
|
||||||
// Process rawInput first, then input, then current buffer
|
if inputBuffer, err := buf.ReadFrom(w.input); err == nil && !inputBuffer.IsEmpty() {
|
||||||
if w.rawInput != nil {
|
buffer, _ = buf.MergeMulti(buffer, inputBuffer)
|
||||||
if rawInputBuffer, err := buf.ReadFrom(w.rawInput); err == nil && !rawInputBuffer.IsEmpty() {
|
|
||||||
buffer, _ = buf.MergeMulti(buffer, rawInputBuffer)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if w.input != nil {
|
if rawInputBuffer, err := buf.ReadFrom(w.rawInput); err == nil && !rawInputBuffer.IsEmpty() {
|
||||||
if inputBuffer, err := buf.ReadFrom(w.input); err == nil && !inputBuffer.IsEmpty() {
|
buffer, _ = buf.MergeMulti(buffer, rawInputBuffer)
|
||||||
buffer, _ = buf.MergeMulti(buffer, inputBuffer)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if w.input != nil {
|
|
||||||
*w.input = bytes.Reader{} // release memory
|
|
||||||
w.input = nil
|
|
||||||
}
|
|
||||||
if w.rawInput != nil {
|
|
||||||
*w.rawInput = bytes.Buffer{} // release memory
|
|
||||||
w.rawInput = nil
|
|
||||||
}
|
}
|
||||||
|
*w.input = bytes.Reader{} // release memory
|
||||||
|
w.input = nil
|
||||||
|
*w.rawInput = bytes.Buffer{} // release memory
|
||||||
|
w.rawInput = nil
|
||||||
|
|
||||||
if inbound := session.InboundFromContext(w.ctx); inbound != nil && inbound.Conn != nil {
|
if inbound := session.InboundFromContext(w.ctx); inbound != nil && inbound.Conn != nil {
|
||||||
// if w.isUplink && inbound.CanSpliceCopy == 2 { // TODO: enable uplink splice
|
// if w.isUplink && inbound.CanSpliceCopy == 2 { // TODO: enable uplink splice
|
||||||
|
|||||||
Reference in New Issue
Block a user