From 1317eeca43b7c3c48a3f291483bb807648016d22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Helge=20He=C3=9F?= Date: Tue, 24 Jun 2014 11:50:13 +0200 Subject: [PATCH] Added support for MKCALENDAR Signed-off-by: Fedor Indutny --- http_parser.c | 4 +++- http_parser.h | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/http_parser.c b/http_parser.c index df1b696..69dea71 100644 --- a/http_parser.c +++ b/http_parser.c @@ -925,7 +925,7 @@ size_t http_parser_execute (http_parser *parser, case 'G': parser->method = HTTP_GET; break; case 'H': parser->method = HTTP_HEAD; break; case 'L': parser->method = HTTP_LOCK; break; - case 'M': parser->method = HTTP_MKCOL; /* or MOVE, MKACTIVITY, MERGE, M-SEARCH */ break; + case 'M': parser->method = HTTP_MKCOL; /* or MOVE, MKACTIVITY, MERGE, M-SEARCH, MKCALENDAR */ break; case 'N': parser->method = HTTP_NOTIFY; break; case 'O': parser->method = HTTP_OPTIONS; break; case 'P': parser->method = HTTP_POST; @@ -977,6 +977,8 @@ size_t http_parser_execute (http_parser *parser, parser->method = HTTP_MSEARCH; } else if (parser->index == 2 && ch == 'A') { parser->method = HTTP_MKACTIVITY; + } else if (parser->index == 3 && ch == 'A') { + parser->method = HTTP_MKCALENDAR; } else { SET_ERRNO(HPE_INVALID_METHOD); goto error; diff --git a/http_parser.h b/http_parser.h index d150f26..3ba4c7e 100644 --- a/http_parser.h +++ b/http_parser.h @@ -117,6 +117,8 @@ typedef int (*http_cb) (http_parser*); /* RFC-5789 */ \ XX(24, PATCH, PATCH) \ XX(25, PURGE, PURGE) \ + /* CalDAV */ \ + XX(26, MKCALENDAR, MKCALENDAR) \ enum http_method {