Merge pull request #669 from pymongo/master

Make postgres protocol version value more readable
This commit is contained in:
Steven Fackler 2020-10-17 08:04:08 -04:00 committed by GitHub
commit 91144b91e3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -260,7 +260,8 @@ where
I: IntoIterator<Item = (&'a str, &'a str)>,
{
write_body(buf, |buf| {
buf.put_i32(196_608);
// postgres protocol version 3.0(196608) in bigger-endian
buf.put_i32(0x00_03_00_00);
for (key, value) in parameters {
write_cstr(key.as_bytes(), buf)?;
write_cstr(value.as_bytes(), buf)?;