From 08472c27c77d27ea084e3458842540351c5a5c28 Mon Sep 17 00:00:00 2001 From: Martin Ashby Date: Wed, 27 Sep 2023 20:23:30 +0100 Subject: Add cleartext password handling. Fix segfault on error response read. Add test for tcp connection and incorrect password --- src/main.zig | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/main.zig') 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); -- cgit v1.2.3-ZIG