Skip to content

Commit 0b0772c

Browse files
pallasindutny
authored andcommitted
constants: add RTSP/RAOP methods
I'm looking at replacing http-parser with llhttp in rpiplay [1]. These are the additional methods used to implement Airplay2 [2]. RTSP [3] uses the verb OPTIONS and adds DESCRIBE, ANNOUNCE, SETUP, PLAY, PAUSE, TEARDOWN, GET_PARAMETER, SET_PARAMETER, REDIRECT, & RECORD. RAOP additionally adds FLUSH. [1] https://github.com/FD-/RPiPlay [2] https://git.zx2c4.com/Airtunes2/about/ [3] https://tools.ietf.org/html/rfc2326 Signed-off-by: Derrick Lyndon Pallas <[email protected]> PR-URL: #68 Reviewed-By: Fedor Indutny <[email protected]>
1 parent dd7f9fe commit 0b0772c

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

src/llhttp/constants.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,19 @@ export enum METHODS {
9898
SOURCE = 33,
9999
/* RFC-7540, section 11.6 */
100100
PRI = 34,
101+
/* RFC-2326 RTSP */
102+
DESCRIBE = 35,
103+
ANNOUNCE = 36,
104+
SETUP = 37,
105+
PLAY = 38,
106+
PAUSE = 39,
107+
TEARDOWN = 40,
108+
GET_PARAMETER = 41,
109+
SET_PARAMETER = 42,
110+
REDIRECT = 43,
111+
RECORD = 44,
112+
/* RAOP */
113+
FLUSH = 45,
101114
}
102115

103116
export const METHOD_MAP = enumToMap(METHODS);

src/llhttp/http.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -317,6 +317,7 @@ export class HTTP {
317317

318318
n('req_http_start')
319319
.match('HTTP/', n('req_http_major'))
320+
.match('RTSP/', n('req_http_major'))
320321
.match('ICE/', isSource)
321322
.match(' ', n('req_http_start'))
322323
.otherwise(p.error(ERROR.INVALID_CONSTANT, 'Expected HTTP/'));

0 commit comments

Comments
 (0)