summary refs log tree commit diff
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2020-05-01 16:51:28 -0400
committerJune McEnroe <june@causal.agency>2020-05-01 16:51:28 -0400
commitc408824619f0dffd3556b1374a2c4f4124640d5d (patch)
treeeaff06fa137f17aa12a32ec7626ab9d54c40a289
parentAdd generator links (diff)
downloadbubger-c408824619f0dffd3556b1374a2c4f4124640d5d.tar.gz
bubger-c408824619f0dffd3556b1374a2c4f4124640d5d.zip
Support continue responses
Basically just so that this can be the canonical imap.[ch] for copying
into other projects.
-rw-r--r--imap.c5
-rw-r--r--imap.h3
2 files changed, 7 insertions, 1 deletions
diff --git a/imap.c b/imap.c
index b47a520..e3349a7 100644
--- a/imap.c
+++ b/imap.c
@@ -173,6 +173,11 @@ struct Resp imapResp(FILE *imap) {
 	data = parseData(imap);
 	if (data.type != Atom) errx(EX_PROTOCOL, "expected tag atom");
 	resp.tag = data.atom;
+	if (resp.tag == AtomContinue) {
+		if (*ptr == ' ') ptr++;
+		resp.text = ptr;
+		return resp;
+	}
 
 	data = parseData(imap);
 	if (data.type == Number) {
diff --git a/imap.h b/imap.h
index 0aa5636..1bb57f5 100644
--- a/imap.h
+++ b/imap.h
@@ -60,7 +60,8 @@
 	X(AtomHeader, "HEADER") \
 	X(AtomText, "TEXT") \
 	X(AtomDot, ".") \
-	X(AtomUntagged, "*")
+	X(AtomUntagged, "*") \
+	X(AtomContinue, "+")
 
 enum Atom {
 #define X(id, str) id,