| 1 |
|
| MODE: INLINE |
| 2 |
|
| |
| 3 |
|
| namespace { |
| 4 |
|
| struct XSRequestParserFactory : RequestParser::IFactory { |
| 5 |
|
| RequestSP new_request () override { return new XSRequest(); } |
| 6 |
|
| }; |
| 7 |
|
| static XSRequestParserFactory xs_request_parser_factory; |
| 8 |
|
| } |
| 9 |
|
| |
| 10 |
|
| MODULE = Protocol::HTTP PACKAGE = Protocol::HTTP::RequestParser |
| 11 |
|
| PROTOTYPES: DISABLE |
| 12 |
|
| |
| 13 |
|
| RequestParser* RequestParser::new () { |
| 14 |
0 |
| RETVAL = new RequestParser(&xs_request_parser_factory); |
| 15 |
0 |
▶ | } |
Branch: 1 branch
| Branch | True | False | Total |
| } |
0 |
0 |
0 |
|
| 16 |
0 |
▶ | |
Branch: 4 branches
| Branch | True | False | Total |
|
0 |
0 |
0 |
|
0 |
0 |
0 |
|
0 |
0 |
0 |
|
0 |
0 |
0 |
|
| 17 |
|
| void RequestParser::parse (const string& buf) : ALIAS(parse_shift=1) { |
| 18 |
0 |
▶ | if (ix && !buf) XSRETURN_EMPTY; // make "while(my(...) = $p->parse_shift($s)) {}" stop when string is fully parsed |
Branch: 3 branches
| Branch | True | False | Total |
| if (ix && !buf) XSRETURN_EMPTY; // make "while(my(...) = $p->parse_shift($s)) {}" stop when string is fully parsed |
0 |
0 |
0 |
| if (ix && !buf) XSRETURN_EMPTY; // make "while(my(...) = $p->parse_shift($s)) {}" stop when string is fully parsed |
0 |
0 |
0 |
| if (ix && !buf) XSRETURN_EMPTY; // make "while(my(...) = $p->parse_shift($s)) {}" stop when string is fully parsed |
0 |
0 |
0 |
|
| 19 |
0 |
▶ | auto result = THIS->parse(buf); |
Branch: 1 branch
| Branch | True | False | Total |
| auto result = THIS->parse(buf); |
0 |
0 |
0 |
|
| 20 |
0 |
| SV* bufsv = ST(1); |
| 21 |
0 |
▶ | EXTEND(SP, 4); |
Branch: 2 branches
| Branch | True | False | Total |
| EXTEND(SP, 4); |
0 |
0 |
0 |
| EXTEND(SP, 4); |
0 |
0 |
0 |
|
| 22 |
|
| |
| 23 |
0 |
▶ | mPUSHs(xs::out(result.request).detach()); |
Branch: 2 branches
| Branch | True | False | Total |
| mPUSHs(xs::out(result.request).detach()); |
0 |
0 |
0 |
| mPUSHs(xs::out(result.request).detach()); |
0 |
0 |
0 |
|
| 24 |
0 |
▶ | mPUSHs(xs::out(result.state).detach()); |
Branch: 2 branches
| Branch | True | False | Total |
| mPUSHs(xs::out(result.state).detach()); |
0 |
0 |
0 |
| mPUSHs(xs::out(result.state).detach()); |
0 |
0 |
0 |
|
| 25 |
|
| |
| 26 |
0 |
▶ | if (ix) sv_insert(bufsv, 0, result.position, "", 0); |
Branch: 2 branches
| Branch | True | False | Total |
| if (ix) sv_insert(bufsv, 0, result.position, "", 0); |
0 |
0 |
0 |
| if (ix) sv_insert(bufsv, 0, result.position, "", 0); |
0 |
0 |
0 |
|
| 27 |
0 |
▶ | else mPUSHu(result.position); |
Branch: 2 branches
| Branch | True | False | Total |
| else mPUSHu(result.position); |
0 |
0 |
0 |
| else mPUSHu(result.position); |
0 |
0 |
0 |
|
| 28 |
|
| |
| 29 |
0 |
▶ | if (result.error) mPUSHs(xs::out(result.error).detach()); |
Branch: 3 branches
| Branch | True | False | Total |
| if (result.error) mPUSHs(xs::out(result.error).detach()); |
0 |
0 |
0 |
| if (result.error) mPUSHs(xs::out(result.error).detach()); |
0 |
0 |
0 |
| if (result.error) mPUSHs(xs::out(result.error).detach()); |
0 |
0 |
0 |
|
| 30 |
|
| } |
| 31 |
|
| |
| 32 |
0 |
| void RequestParser::reset () |
| 33 |
|
| |
| 34 |
|
| SV* CLONE_SKIP (...) { |
| 35 |
0 |
| XSRETURN_YES; |
| 36 |
|
| PERL_UNUSED_VAR(items); |
| 37 |
|
| } |