Commit Graph

21 Commits (175856ffd3c8377db2e631b99ef7a7c996fdae77)

Author SHA1 Message Date
Oliver Tan 175856ffd3 add GSS authentication to pgproto3 2022-04-12 07:13:21 -05:00
Yuli Khodorkovskiy 7c9e840726 Add support for identifying authentication messages
The pgprotocol overloads 'p' messages with PasswordMessage,
SASLInitialResponse, SASLResponse, and GSSResponse. This patch allows
contextual identification of the message by setting the authType in the
frontend and then setting this value in the backend when a
AuthenticationResponseMessage is received.
2021-06-12 13:54:34 -05:00
Jack Christensen fede0ce5d6 Document that received messages are only valid until the next receive. 2020-09-05 11:30:23 -05:00
Jack Christensen 595780be0f Map io.EOF errors to io.ErrUnexpectedEOF
io.EOF is never expected during valid usage. In addition, database/sql
uses io.EOF as a sentinal value that all rows from a query have been
received.

See https://github.com/jackc/pgx/issues/662.
2020-01-17 16:55:05 -06:00
Jack Christensen 0d1ceed7a6 Refactor authentication message handling 2019-08-31 15:43:07 -05:00
Jack Christensen 439ea11d47 NewFrontend and NewBackend cannot fail 2019-08-31 14:49:55 -05:00
Jack Christensen 2bc8f2e6af Remove pkg/errors package 2019-08-31 11:53:26 -05:00
Jack Christensen 432c2951c7 Add a lot of documentation 2019-06-08 19:38:34 -05:00
Jack Christensen 18e7e777be Import PortalSuspended from pgx v3
0ab6f80f99
2019-06-08 10:26:26 -05:00
Jack Christensen a340d5f15f CopyFail should be frontend message 2019-05-17 13:27:11 -05:00
Jack Christensen bb06e6b3ff Decouple github.com/jackc/chunkreader 2019-03-30 12:46:56 -05:00
Jack Christensen 16176b5151 Add go module support 2019-03-30 12:26:24 -05:00
Jack Christensen 440fbf1581 Include missed changes 2019-01-26 12:21:54 -06:00
Murat Kabilov 5f39bbaf35 Add *Conn. CopyFromTextual, CopyToTextual, which use textual format for copying data 2018-07-31 08:57:53 +02:00
Jack Christensen b3d0cbd0e6 Fix reading interrupted messages
When an message is received and a timeout occurs after reading the
header but before reading the entire body the connection state could
be corrupted due to the header being consumed. The next read would
consider the body of the previous message as the header for the next.

fixes #348
2017-12-16 13:45:22 -06:00
Jack Christensen ffa9ff2213 Use github.com/pkg/errors 2017-06-04 21:30:03 -05:00
Jack Christensen d6312305ae Replace MarshalBinary with Encode
This new approach can avoid allocations.
2017-05-26 17:00:44 -05:00
Jack Christensen 61d4386931 Update pgproto3 to enable pgmock 2017-05-06 08:48:40 -05:00
Jack Christensen eff55451cf Reduce allocations and copies in pgproto3
Altered chunkreader to never reuse memory.

Altered pgproto3 to to copy memory when decoding. Renamed UnmarshalBinary to
Decode because of changed semantics.
2017-04-29 11:55:14 -05:00
Jack Christensen de9bb7e6d8 Use flyweight pattern for pgproto3 messages 2017-04-29 11:01:54 -05:00
Jack Christensen 4e2900b774 Introduce pgproto3 package
pgproto3 will wrap the message encoding and decoding for the PostgreSQL
frontend/backend protocol version 3.
2017-04-29 10:02:38 -05:00