Fix byte representation of CancelRequest message

I noticed that query cancellation was not working when connecting through pgbouncer,
even though it worked fine when directly connected. This is because we're appending an
extra null byte, and pgbouncer is strict about the packet length.
(per http://www.postgresql.org/docs/9.1/static/protocol-message-formats.html)

This removes the extraneous byte, which fixes cancellation against pgbouncer.
This commit is contained in:
Dorian Johnson 2016-03-09 16:13:54 -08:00
parent 93aa52d43b
commit eb7b15c623

View File

@ -159,7 +159,7 @@ Connection.prototype.cancel = function(processID, secretKey) {
.addInt16(5678)
.addInt32(processID)
.addInt32(secretKey)
.addCString('').flush();
.flush();
var length = bodyBuffer.length + 4;