xs/serve.xs

filter: Statementstmt 0.0% 0 / 6 Branchbran 0.0% 0 / 8 Conditioncond n/a MC/DCmcdc n/a Subroutinesub n/a Podpod n/a totaltotal 0.0% 0 / 14 CC 0 SCAR 0
CC
0
Cov
0%
CRAP 0
« blib/lib/Punk/Controller.pm ↑ Summary xs/dispatch.xs »
1 MODULE = Punk PACKAGE = Punk
2  
3 PROTOTYPES: DISABLE
4  
5 # The request dispatcher (punk_serve.h). compile() freezes the routing state
6 # and returns sub { Punk::_serve($state, $env) }: static/dynamic routing, the
7 # API-mount route+dispatch, PSGI mounts, 404/405, and for a web route the
8 # before hooks, guards, controller (or websocket upgrade) and response finish -
9 # all in C. Only the hooks/guards/controllers/mounts are Perl frames.
10 SV *
11 # uncoverable statement
12 # uncoverable subroutine
13 _serve(state, env)
14 SV *state
15 SV *env
16 CODE:
17 {
18 0 ▶ # uncoverable statement
Branch: 2 branches
BranchTrueFalseTotal
# uncoverable statement 0 0 0
# uncoverable statement 0 0 0
19 0 # uncoverable branch true
20 0 ▶ # uncoverable branch false
Branch: 2 branches
BranchTrueFalseTotal
# uncoverable branch false 0 0 0
# uncoverable branch false 0 0 0
21 0 # uncoverable condition left count:1
22 # uncoverable condition right count:1
23 0 # uncoverable condition left count:2
24 0 # uncoverable condition right count:2
25 if (!SvROK(state) || SvTYPE(SvRV(state)) != SVt_PVHV)
26 croak("Punk::_serve: state must be a hashref"); /* # uncoverable statement */
27 # uncoverable statement
28 # uncoverable branch true
29 # uncoverable branch false
30 # uncoverable condition left count:1
31 # uncoverable condition right count:1
32 # uncoverable condition left count:2
33 # uncoverable condition right count:2
34 if (!SvROK(env) || SvTYPE(SvRV(env)) != SVt_PVHV)
35 croak("Punk::_serve: env must be a hashref"); /* # uncoverable statement */
36 { /* the struct the app closure carries, built for this one call */
37 SV *holder = sv_2mortal(pk_state_build(aTHX_ (HV *)SvRV(state))); /* # uncoverable statement */
38 RETVAL = punk_serve(aTHX_ pk_state_of(aTHX_ holder), (HV *)SvRV(env)); /* # uncoverable statement */
39 }
40 }
41 OUTPUT:
42 RETVAL
« blib/lib/Punk/Controller.pm ↑ Summary xs/dispatch.xs »