Skip to content

Commit eb7b15c

Browse files
author
Dorian Johnson
committed
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.
1 parent 93aa52d commit eb7b15c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/connection.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ Connection.prototype.cancel = function(processID, secretKey) {
159159
.addInt16(5678)
160160
.addInt32(processID)
161161
.addInt32(secretKey)
162-
.addCString('').flush();
162+
.flush();
163163

164164
var length = bodyBuffer.length + 4;
165165

0 commit comments

Comments
 (0)