aboutsummaryrefslogtreecommitdiff
path: root/nexgb
diff options
context:
space:
mode:
authoraarzilli <alessandro.arzilli@gmail.com>2015-11-08 10:56:15 +0100
committerPřemysl Janouch <p@janouch.name>2018-09-08 16:49:24 +0200
commitbaff8c19067489ea26bbb804ef693e966202b511 (patch)
tree4ae49572739ae2ad7d65e8877ccfc1ee36e77336 /nexgb
parent5451e59f884298fdf97ef4420a7bc1001093c3b7 (diff)
downloadhaven-baff8c19067489ea26bbb804ef693e966202b511.tar.gz
haven-baff8c19067489ea26bbb804ef693e966202b511.tar.xz
haven-baff8c19067489ea26bbb804ef693e966202b511.zip
sendRequest reads req.buf after closing req.seq
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.
Diffstat (limited to 'nexgb')
-rw-r--r--nexgb/xgb.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/nexgb/xgb.go b/nexgb/xgb.go
index 487ae16..44634fe 100644
--- a/nexgb/xgb.go
+++ b/nexgb/xgb.go
@@ -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