From 21bb677c1f395541a1b0610a0f576d58ce778273 Mon Sep 17 00:00:00 2001 From: "C. McEnroe" Date: Thu, 27 Feb 2020 02:56:54 -0500 Subject: Send CAP LS 302 to the server --- bounce.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'bounce.h') diff --git a/bounce.h b/bounce.h index 5aff027..1eb5ce9 100644 --- a/bounce.h +++ b/bounce.h @@ -102,19 +102,20 @@ static const char *CapNames[] = { #undef X }; -static inline enum Cap capParse(const char *list) { +static inline enum Cap capParse(const char *list, const char *values[CapBits]) { enum Cap caps = 0; while (*list) { enum Cap cap = CapUnsupported; - size_t len = strcspn(list, " "); + size_t len = strcspn(list, "= "); for (size_t i = 0; i < ARRAY_LEN(CapNames); ++i) { if (len != strlen(CapNames[i])) continue; if (strncmp(list, CapNames[i], len)) continue; cap = 1 << i; + if (list[len] == '=' && values) values[i] = &list[len + 1]; break; } caps |= cap; - list += len; + list += strcspn(list, " "); if (*list) list++; } return caps; -- cgit 1.4.1