Skip to content

Commit

Permalink
adjusted rtsp parser, unsigned char before assign to ushort
Browse files Browse the repository at this point in the history
  • Loading branch information
izuzanak committed Sep 9, 2023
1 parent 8038f4e commit afd601e
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 3 deletions.
7 changes: 5 additions & 2 deletions build/rules/camsys/rtsp.rules
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ terminals:
header_ignore {(
"Accept"+
"Accept-Language"+
"Bandwidth"+
"Blocksize"+
"Cache-Control"+
"ClientChallenge"+
"ClientID"+
Expand All @@ -36,6 +38,7 @@ terminals:
"Host"+
"Icy-MetaData"+
"Immediate"+
"MS-Reason" +
"PlayerStarttime"+
"Pragma"+
"RTP-Info"+
Expand Down Expand Up @@ -93,7 +96,7 @@ terminals:
auth_uri {"uri="}
auth_response {"response="}
auth_stale {"stale=".|,\r|*}
auth_qop {"qop="}
auth_ignore {("qop"+"algorithm").'='}

separator {[,;]}

Expand Down Expand Up @@ -192,5 +195,5 @@ rules:
<auth> -> auth_uri string ->> {print("uri: "..rule_body(1))}
<auth> -> auth_response string ->> {print("response: "..rule_body(1))}
<auth> -> auth_stale ->> {print("stale: "..string.sub(rule_body(0),7,-1))}
<auth> -> auth_qop string ->> {print("qop: "..rule_body(1))}
<auth> -> auth_ignore string ->> {print("ignore: "..rule_body(1))}

19 changes: 19 additions & 0 deletions build/rules/camsys/rtsp.src
Original file line number Diff line number Diff line change
Expand Up @@ -205,4 +205,23 @@ CSeq: 4
Content-Type: text/parameters
Server: gortsplib
Session: 28ddf1ec-9514-4178-a92a-42ba993d64f6
CSeq: 1
Accept: application/sdp
User-Agent: CmRtspClient 12.7a.949
Bandwidth: 384000
CSeq: 2
Accept: application/sdp
User-Agent: CmRtspClient 12.7a.949
Bandwidth: 384000
Authorization: Digest username="jirka", realm="NVR Streaming Server", nonce="07461e6de4682cfe4cf745fe75631ad961e79b80", algorithm="MD5", uri="rtsp://172.19.19.155:8006/onvif/recorder/57043005/last/all/burst", response="84965d9774604696c5470245c601819b"
CSeq: 3
User-Agent: CmRtspClient 12.7a.949
Transport: RTP/AVP/TCP;unicast;interleaved=0-1
Blocksize: 65535
Authorization: Digest username="jirka", realm="NVR Streaming Server", nonce="03a691999166fbea20a2465629f201fda442bce0", algorithm="MD5", uri="rtsp://192.168.3.2:8006/onvif/recorder/56043003/last/all/single/", response="8d96331b4ceb98e6601c28f7b2852c7f"
Session: 1692080269358517
CSeq: 22
User-Agent: CmRtspClient 12.7a.949
Authorization: Digest username="jirka", realm="NVR Streaming Server", nonce="022693850ea2e9dd325b61a2e87a9872b9e284cd", algorithm="MD5", uri="rtsp://192.168.3.2:8006/onvif/recorder/56043003/last/all/single/", response="f28182a8dce0411a24f7fa485480849a"
MS-Reason: [741]RtspDisconnect/[889]FailedDescribe(401)/

2 changes: 1 addition & 1 deletion yapgen/header_files/parser_code.h
Original file line number Diff line number Diff line change
Expand Up @@ -779,7 +779,7 @@ inline unsigned short reg_parser_s::process_char(char *&c_ptr)
}
else
{
return *c_ptr++;
return (unsigned char)*c_ptr++;
}
}/*}}}*/

Expand Down

0 comments on commit afd601e

Please sign in to comment.