aboutsummaryrefslogtreecommitdiff
path: root/src/main.zig
diff options
context:
space:
mode:
authorMartin Ashby <martin@ashbysoft.com>2023-09-27 20:23:30 +0100
committerMartin Ashby <martin@ashbysoft.com>2023-09-27 20:23:30 +0100
commit08472c27c77d27ea084e3458842540351c5a5c28 (patch)
tree67029d8f6779b107ec8d0cf370981045ccea1e30 /src/main.zig
parent4c5101d5f3a60c58190809166f1aa1eac2e7875f (diff)
downloadpgz-08472c27c77d27ea084e3458842540351c5a5c28.tar.gz
pgz-08472c27c77d27ea084e3458842540351c5a5c28.tar.bz2
pgz-08472c27c77d27ea084e3458842540351c5a5c28.tar.xz
pgz-08472c27c77d27ea084e3458842540351c5a5c28.zip
Add cleartext password handling.
Fix segfault on error response read. Add test for tcp connection and incorrect password
Diffstat (limited to 'src/main.zig')
-rw-r--r--src/main.zig11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/main.zig b/src/main.zig
index c8a9d8e..818b3b7 100644
--- a/src/main.zig
+++ b/src/main.zig
@@ -12,19 +12,20 @@ pub const ProtocolError = error{
InvalidFormatCode,
};
+pub const FormatCode = enum(u16) {
+ Text = 0,
+ Binary = 1,
+};
+
pub const ClientError = error{
UnsupportedAuthType,
+ NoPasswordSupplied,
};
pub const ServerError = error{
ErrorResponse,
};
-pub const FormatCode = enum(u16) {
- Text = 0,
- Binary = 1,
-};
-
// Fallible version of enumFromInt
pub fn enum_from_int(comptime e: type, i: anytype) ?e {
const enum_ti = @typeInfo(e);