mirror of
https://github.com/schollz/croc.git
synced 2025-10-11 13:21:00 +02:00
try fix
This commit is contained in:
parent
d2a708eaaa
commit
7a961ecffd
1 changed files with 7 additions and 2 deletions
|
@ -2,6 +2,7 @@ package tcp
|
|||
|
||||
import (
|
||||
"bufio"
|
||||
"bytes"
|
||||
"net"
|
||||
"sync"
|
||||
"time"
|
||||
|
@ -167,14 +168,18 @@ func pipe(conn1 net.Conn, conn2 net.Conn) {
|
|||
return
|
||||
}
|
||||
writer2.Write(b1)
|
||||
writer2.Flush()
|
||||
if bytes.Equal(b1, "magic") {
|
||||
writer2.Flush()
|
||||
}
|
||||
|
||||
case b2 := <-chan2:
|
||||
if b2 == nil {
|
||||
return
|
||||
}
|
||||
writer1.Write(b2)
|
||||
writer1.Flush()
|
||||
if bytes.Equal(b2, "magic") {
|
||||
writer1.Flush()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue