+/** @brief Match cookie separator characters
+ *
+ * This is a subset of the RFC2616 specials, and technically is in breach of
+ * the specification. However rejecting (in particular) slashes is
+ * unreasonably strict and has broken at least one (admittedly somewhat
+ * obscure) browser, so we're more forgiving.
+ */
+static int cookie_separator(int c) {
+ switch(c) {
+ case '(':
+ case ')':
+ case ',':
+ case ';':
+ case '=':
+ case ' ':
+ case '"':
+ case '\t':
+ return 1;
+
+ default:
+ return 0;
+ }
+}
+
+/** @brief Match cookie value separator characters
+ *
+ * Same as cookie_separator() but allows for @c = in cookie values.
+ */
+static int cookie_value_separator(int c) {
+ switch(c) {
+ case '(':
+ case ')':
+ case ',':
+ case ';':
+ case ' ':
+ case '"':
+ case '\t':
+ return 1;
+
+ default:
+ return 0;
+ }
+}
+