Skip to content

Commit 27fffad

Browse files
committed
Custom methods LISTEN, STATS, SIGN, ENCRYPT
1 parent 5c17dad commit 27fffad

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

http_parser.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -936,17 +936,18 @@ size_t http_parser_execute (http_parser *parser,
936936
case 'B': parser->method = HTTP_BIND; break;
937937
case 'C': parser->method = HTTP_CONNECT; /* or COPY, CHECKOUT */ break;
938938
case 'D': parser->method = HTTP_DELETE; break;
939+
case 'E': parser->method = HTTP_ENCRYPT; break;
939940
case 'G': parser->method = HTTP_GET; break;
940941
case 'H': parser->method = HTTP_HEAD; break;
941-
case 'L': parser->method = HTTP_LOCK; /* or LINK */ break;
942+
case 'L': parser->method = HTTP_LOCK; /* or LINK, LISTEN */ break;
942943
case 'M': parser->method = HTTP_MKCOL; /* or MOVE, MKACTIVITY, MERGE, M-SEARCH, MKCALENDAR */ break;
943944
case 'N': parser->method = HTTP_NOTIFY; break;
944945
case 'O': parser->method = HTTP_OPTIONS; break;
945946
case 'P': parser->method = HTTP_POST;
946947
/* or PROPFIND|PROPPATCH|PUT|PATCH|PURGE */
947948
break;
948949
case 'R': parser->method = HTTP_REPORT; /* or REBIND */ break;
949-
case 'S': parser->method = HTTP_SUBSCRIBE; /* or SEARCH, SOURCE */ break;
950+
case 'S': parser->method = HTTP_SUBSCRIBE; /* or SEARCH, SOURCE, STATS, SIGN */ break;
950951
case 'T': parser->method = HTTP_TRACE; break;
951952
case 'U': parser->method = HTTP_UNLOCK; /* or UNSUBSCRIBE, UNBIND, UNLINK */ break;
952953
default:
@@ -993,9 +994,12 @@ size_t http_parser_execute (http_parser *parser,
993994
XX(MKCOL, 3, 'A', MKCALENDAR)
994995
XX(SUBSCRIBE, 1, 'E', SEARCH)
995996
XX(SUBSCRIBE, 1, 'O', SOURCE)
997+
XX(SUBSCRIBE, 1, 'T', STATS)
998+
XX(SUBSCRIBE, 1, 'I', SIGN)
996999
XX(REPORT, 2, 'B', REBIND)
9971000
XX(PROPFIND, 4, 'P', PROPPATCH)
9981001
XX(LOCK, 1, 'I', LINK)
1002+
XX(LINK, 2, 'S', LISTEN)
9991003
XX(UNLOCK, 2, 'S', UNSUBSCRIBE)
10001004
XX(UNLOCK, 2, 'B', UNBIND)
10011005
XX(UNLOCK, 3, 'I', UNLINK)

http_parser.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,10 @@ enum http_status
203203
XX(32, UNLINK, UNLINK) \
204204
/* icecast */ \
205205
XX(33, SOURCE, SOURCE) \
206+
XX(34, LISTEN, LISTEN) \
207+
XX(35, STATS, STATS) \
208+
XX(36, SIGN, SIGN) \
209+
XX(37, ENCRYPT, ENCRYPT) \
206210

207211
enum http_method
208212
{

test.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4366,6 +4366,9 @@ main (void)
43664366
"MKCALENDAR",
43674367
"LINK",
43684368
"UNLINK",
4369+
"LISTEN",
4370+
"STATS",
4371+
"SIGN",
43694372
0 };
43704373
const char **this_method;
43714374
for (this_method = all_methods; *this_method; this_method++) {

0 commit comments

Comments
 (0)