Skip to content

Commit

Permalink
Buffer reuse
Browse files Browse the repository at this point in the history
  • Loading branch information
cbeuw committed Mar 27, 2018
1 parent 1cc5cb6 commit 06212b3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cmd/gq-client/gq-client.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ func (p *pair) remoteToSS() {
}

func (p *pair) ssToRemote() {
buf := make([]byte, 10240)
for {
buf := make([]byte, 10240)
i, err := io.ReadAtLeast(p.ss, buf, 1)
if err != nil {
p.closePipe()
Expand Down
2 changes: 1 addition & 1 deletion cmd/gq-server/gq-server.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ func (pair *ssPair) remoteToServer() {
}

func (pair *ssPair) serverToRemote() {
buf := make([]byte, 10240)
for {
buf := make([]byte, 10240)
i, err := io.ReadAtLeast(pair.ss, buf, 1)
if err != nil {
pair.closePipe()
Expand Down

0 comments on commit 06212b3

Please sign in to comment.