Skip to content

Commit 9744e5f

Browse files
committed
intra/common: m logs
1 parent 70144d3 commit 9744e5f

1 file changed

Lines changed: 10 additions & 6 deletions

File tree

intra/common.go

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -225,22 +225,26 @@ func (h *baseHandler) forward(local, remote net.Conn, smm *SocketSummary) {
225225

226226
tup := conn2str(local, remote)
227227

228-
log.I("com: %s: forward: new conn %s via proxy(%s); %s for %s",
229-
h.proto, cid, via, tup, uid)
230-
231228
h.conntracker.Track(cid, local, remote)
232229
defer h.conntracker.Untrack(cid)
233230

231+
var r rwext
232+
var c core.TCPConn
233+
isrwext := false
234+
iszerodeadline := false
235+
istcpconn := false
234236
// enable core.Pipe (sendfile/zero-copy) optimizations on TCP if
235237
// read & write deadlines are not set (as in rwext is effectively
236238
// a no-op) by unwrapping the underlying remote conn from rwext.
237-
if r, ok := remote.(rwext); ok {
238-
if r.IsZeroDeadline() {
239+
if r, isrwext = remote.(rwext); isrwext {
240+
if iszerodeadline = r.IsZeroDeadline(); iszerodeadline {
239241
remote = r.Unwrap()
240-
} else if c, ok := r.SetAsTCPSockOpt(); ok && c != nil {
242+
} else if c, istcpconn = r.SetAsTCPSockOpt(); istcpconn && c != nil {
241243
remote = c
242244
}
243245
}
246+
log.I("com: %s: forward: new conn %s (via: %s) rwext? %t, zerodeadline? %t, tcpconn? %t; %s for %s",
247+
h.proto, cid, via, isrwext, iszerodeadline, istcpconn, tup, uid)
244248

245249
uploadch := make(chan ioinfo)
246250

0 commit comments

Comments
 (0)