Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
henrybear327 committed Sep 25, 2024
1 parent 8d627e2 commit c8bc2cd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
6 changes: 3 additions & 3 deletions pkg/proxy/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,7 @@ func (s *server) ioCopy(dst, src net.Conn, ptype proxyType, peerPort int) {
}
data := buf[:nr1]

// alters/corrupts/drops data
// drops data
switch ptype {
case proxyTx:
s.modifyTxMu.RLock()
Expand Down Expand Up @@ -550,15 +550,15 @@ func (s *server) ioCopy(dst, src net.Conn, ptype proxyType, peerPort int) {
switch ptype {
case proxyTx:
s.lg.Debug(
"modified tx",
"proxyTx",
zap.String("data-received", humanize.Bytes(uint64(nr1))),
zap.String("data-modified", humanize.Bytes(uint64(nr2))),
zap.String("proxy listening on", s.Listen()),
zap.Int("to peer port", peerPort),
)
case proxyRx:
s.lg.Debug(
"modified rx",
"proxyRx",
zap.String("data-received", humanize.Bytes(uint64(nr1))),
zap.String("data-modified", humanize.Bytes(uint64(nr2))),
zap.String("proxy listening on", s.Listen()),
Expand Down
3 changes: 1 addition & 2 deletions pkg/proxy/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,7 @@ func destroy(t *testing.T, writec chan []byte, donec chan struct{}, proxyServer
select {
case <-proxyServer.Done():
case err := <-proxyServer.Error():
if !strings.HasPrefix(err.Error(), "accept ") ||
!strings.HasSuffix(err.Error(), "use of closed network connection") {
if !strings.HasPrefix(err.Error(), "accept ") && !strings.HasSuffix(err.Error(), "use of closed network connection") {
t.Fatal(err)
}
case <-time.After(3 * time.Second):
Expand Down

0 comments on commit c8bc2cd

Please sign in to comment.