Skip to content

Commit

Permalink
sendRequest reads req.buf after closing req.seq
Browse files Browse the repository at this point in the history
NewRequest says you can avoid reallocating a new buffer for each request by calling it directly.
This is not true if req.seq is closed before req.buf is read.
  • Loading branch information
aarzilli committed Nov 8, 2015
1 parent 3ac861b commit ebcb453
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion xgb.go
Original file line number Diff line number Diff line change
Expand Up @@ -337,9 +337,9 @@ func (c *Conn) sendRequests() {
}
}
req.cookie.Sequence = c.newSequenceId()
close(req.seq)
c.cookieChan <- req.cookie
c.writeBuffer(req.buf)
close(req.seq)
}
response := make(chan struct{})
c.closing <- response
Expand Down

0 comments on commit ebcb453

Please sign in to comment.