xs/RequestParser.xsi

filter: Statementstmt 0.0% 0 / 14 Branchbran 0.0% 0 / 44 Conditioncond n/a MC/DCmcdc n/a Subroutinesub n/a Podpod n/a totaltotal 0.0% 0 / 58 CC 0 SCAR 0
CC
0
Cov
0%
CRAP 0
« xs/Request.xsi ↑ Summary xs/Response.xsi »
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
BranchTrueFalseTotal
} 0 0 0
16 0 ▶ 
Branch: 4 branches
BranchTrueFalseTotal
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
BranchTrueFalseTotal
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
BranchTrueFalseTotal
auto result = THIS->parse(buf); 0 0 0
20 0 SV* bufsv = ST(1);
21 0 ▶ EXTEND(SP, 4);
Branch: 2 branches
BranchTrueFalseTotal
EXTEND(SP, 4); 0 0 0
EXTEND(SP, 4); 0 0 0
22
23 0 ▶ mPUSHs(xs::out(result.request).detach());
Branch: 2 branches
BranchTrueFalseTotal
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
BranchTrueFalseTotal
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
BranchTrueFalseTotal
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
BranchTrueFalseTotal
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
BranchTrueFalseTotal
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 }
« xs/Request.xsi ↑ Summary xs/Response.xsi »