Skip to content

Commit

Permalink
Remove explicit condition for checking total being zero
Browse files Browse the repository at this point in the history
  • Loading branch information
mostafa committed Sep 29, 2024
1 parent aee7b06 commit 4c19dbc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion network/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ func (c *Client) Receive() (int, []byte, *gerr.GatewayDError) {
total += read
buffer.Write(chunk[:read])

if total == 0 || read < c.ReceiveChunkSize {
if read < c.ReceiveChunkSize {
break
}
}
Expand Down
2 changes: 1 addition & 1 deletion network/proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -721,7 +721,7 @@ func (pr *Proxy) receiveTrafficFromClient(conn net.Conn) ([]byte, *gerr.GatewayD
total += read
buffer.Write(chunk[:read])

if total == 0 || read < pr.ClientConfig.ReceiveChunkSize {
if read < pr.ClientConfig.ReceiveChunkSize {
break
}

Expand Down

0 comments on commit 4c19dbc

Please sign in to comment.