Skip to content

Commit

Permalink
constants: add RTSP/RAOP methods
Browse files Browse the repository at this point in the history
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 <derrick@pallas.us>

PR-URL: #68
Reviewed-By: Fedor Indutny <fedor@indutny.com>
  • Loading branch information
pallas authored and indutny committed Oct 18, 2020
1 parent dd7f9fe commit 0b0772c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/llhttp/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,19 @@ export enum METHODS {
SOURCE = 33,
/* RFC-7540, section 11.6 */
PRI = 34,
/* RFC-2326 RTSP */
DESCRIBE = 35,
ANNOUNCE = 36,
SETUP = 37,
PLAY = 38,
PAUSE = 39,
TEARDOWN = 40,
GET_PARAMETER = 41,
SET_PARAMETER = 42,
REDIRECT = 43,
RECORD = 44,
/* RAOP */
FLUSH = 45,
}

export const METHOD_MAP = enumToMap(METHODS);
Expand Down
1 change: 1 addition & 0 deletions src/llhttp/http.ts
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,7 @@ export class HTTP {

n('req_http_start')
.match('HTTP/', n('req_http_major'))
.match('RTSP/', n('req_http_major'))
.match('ICE/', isSource)
.match(' ', n('req_http_start'))
.otherwise(p.error(ERROR.INVALID_CONSTANT, 'Expected HTTP/'));
Expand Down

0 comments on commit 0b0772c

Please sign in to comment.