Skip to content

Commit e4a5344

Browse files
committed
Temp: add some logs
1 parent 33acf3c commit e4a5344

3 files changed

Lines changed: 9 additions & 0 deletions

File tree

common/crypto/chunk.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
package crypto
22

33
import (
4+
"context"
45
"encoding/binary"
56
"io"
67

78
"github.com/xtls/xray-core/common"
89
"github.com/xtls/xray-core/common/buf"
10+
"github.com/xtls/xray-core/common/errors"
911
)
1012

1113
// ChunkSizeDecoder is a utility class to decode size value from bytes.
@@ -117,6 +119,7 @@ func (r *ChunkStreamReader) ReadMultiBuffer() (buf.MultiBuffer, error) {
117119
}
118120
r.leftOverSize = size
119121

122+
errors.LogInfo(context.Background(), "StreamReader read ", size)
120123
mb, err := r.reader.ReadAtMost(size)
121124
if !mb.IsEmpty() {
122125
r.leftOverSize -= mb.Len()

common/mux/reader.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package mux
22

33
import (
4+
"context"
45
"io"
56

67
"github.com/xtls/xray-core/common/buf"
@@ -33,6 +34,7 @@ func (r *PacketReader) ReadMultiBuffer() (buf.MultiBuffer, error) {
3334
}
3435

3536
size, err := serial.ReadUint16(r.reader)
37+
errors.LogInfo(context.Background(), "PacketReader read ", size, r.dest)
3638
if err != nil {
3739
return nil, err
3840
}

common/mux/writer.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
package mux
22

33
import (
4+
"context"
5+
46
"github.com/xtls/xray-core/common"
57
"github.com/xtls/xray-core/common/buf"
8+
"github.com/xtls/xray-core/common/errors"
69
"github.com/xtls/xray-core/common/net"
710
"github.com/xtls/xray-core/common/protocol"
811
"github.com/xtls/xray-core/common/serial"
@@ -106,6 +109,7 @@ func (w *Writer) WriteMultiBuffer(mb buf.MultiBuffer) error {
106109
mb = mb2
107110
chunk = buf.MultiBuffer{b}
108111
}
112+
errors.LogInfo(context.Background(), "MuxWriter write ", chunk.Len(), w.dest)
109113
if err := w.writeData(chunk); err != nil {
110114
return err
111115
}

0 commit comments

Comments
 (0)