summaryrefslogtreecommitdiff
path: root/src/client.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/client.zig')
-rw-r--r--src/client.zig6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/client.zig b/src/client.zig
index 307cd7f..2ae6df6 100644
--- a/src/client.zig
+++ b/src/client.zig
@@ -351,6 +351,12 @@ pub fn ClientWith(comptime tag_count: usize) type {
fn consume(c: *@This(), got: Decoded) ?Done {
if (isT(got.msg.msgType())) return c.die();
if (got.msg == .rversion) return c.version(got);
+ // A server may refuse the Tversion itself (all its slots taken):
+ // the call fails with its words, and nothing more is sent.
+ if (got.msg == .rerror and c.versioning and got.tag == notag) {
+ c.versioning = false;
+ return .{ .tag = notag, .op = .version, .result = .{ .fail = got.msg.rerror.ename } };
+ }
if (c.versioning or c.msize == 0) return c.die();
if (got.tag >= c.tags.len) return c.die();
const slot = &c.tags[got.tag];