This repository was archived by the owner on Nov 6, 2022. It is now read-only.
File tree 2 files changed +19
-2
lines changed
2 files changed +19
-2
lines changed Original file line number Diff line number Diff line change @@ -123,7 +123,7 @@ do { \
123
123
FOR ##_mark = NULL ; \
124
124
} \
125
125
} while (0 )
126
-
126
+
127
127
/* Run the data callback FOR and consume the current byte */
128
128
#define CALLBACK_DATA (FOR ) \
129
129
CALLBACK_DATA_(FOR, p - FOR##_mark, p - data + 1)
@@ -1000,6 +1000,13 @@ size_t http_parser_execute (http_parser *parser,
1000
1000
UPDATE_STATE (s_req_spaces_before_url );
1001
1001
} else if (ch == matcher [parser -> index ]) {
1002
1002
; /* nada */
1003
+ } else if (parser -> method == HTTP_LOCK ) {
1004
+ if (parser -> index == 1 && ch == 'I' ) {
1005
+ parser -> method = HTTP_LINK ;
1006
+ } else {
1007
+ SET_ERRNO (HPE_INVALID_METHOD );
1008
+ goto error ;
1009
+ }
1003
1010
} else if (parser -> method == HTTP_CONNECT ) {
1004
1011
if (parser -> index == 1 && ch == 'H' ) {
1005
1012
parser -> method = HTTP_CHECKOUT ;
@@ -1070,6 +1077,13 @@ size_t http_parser_execute (http_parser *parser,
1070
1077
SET_ERRNO (HPE_INVALID_METHOD );
1071
1078
goto error ;
1072
1079
}
1080
+ } else if (parser -> method == HTTP_UNLOCK && parser -> index == 3 ) {
1081
+ if (ch == 'I' ) {
1082
+ parser -> method = HTTP_UNLINK ;
1083
+ } else {
1084
+ SET_ERRNO (HPE_INVALID_METHOD );
1085
+ goto error ;
1086
+ }
1073
1087
} else if (parser -> index == 4 && parser -> method == HTTP_PROPFIND && ch == 'P' ) {
1074
1088
parser -> method = HTTP_PROPPATCH ;
1075
1089
} else {
Original file line number Diff line number Diff line change @@ -124,6 +124,9 @@ typedef int (*http_cb) (http_parser*);
124
124
XX (29 , PURGE , PURGE ) \
125
125
/* CalDAV */ \
126
126
XX (30 , MKCALENDAR , MKCALENDAR ) \
127
+ /* RFC-7237 */ \
128
+ XX (31 , LINK , LINK ) \
129
+ XX (32 , UNLINK , UNLINK )
127
130
128
131
enum http_method
129
132
{
@@ -149,7 +152,7 @@ enum flags
149
152
150
153
151
154
/* Map for errno-related constants
152
- *
155
+ *
153
156
* The provided argument should be a macro that takes 2 arguments.
154
157
*/
155
158
#define HTTP_ERRNO_MAP (XX ) \
You can’t perform that action at this time.
0 commit comments