Skip to content

Commit

Permalink
89 invalid startup packet layout (#115)
Browse files Browse the repository at this point in the history
* Removing unnecessary client_encoding

* Added null terminator to protocol_version as required by protocol definition
  • Loading branch information
DMickens authored Feb 3, 2023
1 parent 5a2347a commit 0d81afe
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions packages/v-protocol/src/serializer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,7 @@ const startup = (opts: Record<string, string>): Buffer => {
}
writer.addCString(key).addCString(opts[key])
}
writer.addCString('protocol_version').addInt32(parseInt(opts['protocol_version']))
writer.addCString('client_encoding').addCString('UTF8')
writer.addCString('protocol_version').addInt32(parseInt(opts['protocol_version'])).addCString('')

var bodyBuffer = writer.addCString('').flush()
// this message is sent without a code
Expand Down

0 comments on commit 0d81afe

Please sign in to comment.