xs/conditionalget.xs

filter: Statementstmt 100% 7 / 7 Branchbran 50.0% 6 / 10 (1 uncoverable) Conditioncond n/a MC/DCmcdc n/a Subroutinesub n/a Podpod n/a totaltotal 70.5% 13 / 17 (1 uncoverable) CC 0 SCAR 0
CC
0
Cov
0%
CRAP 0
« include/punk/punk_wsroom.h ↑ Summary xs/sendfile.xs »
1 MODULE = Punk PACKAGE = Punk::Plugin::ConditionalGet
2  
3 PROTOTYPES: DISABLE
4  
5 # register($app, \%opts)
6 #
7 # The plugin is an on-switch and a place for the documentation to live: the
8 # work is the `etag` route option and the check in punk_cget.h, which the
9 # dispatcher runs between a route's guards and its handler.
10 #
11 # It is registered rather than always-on because the option changes what a
12 # request costs and what a client caches, and because a route option that
13 # does something only when a plugin is loaded is the arrangement `sitemap`
14 # already established.
15 void
16 register(self, app, opts = &PL_sv_undef)
17 SV *self
18 SV *app
19 SV *opts
20 CODE:
21 {
22 21 HV *h = app_hv(aTHX_ app);
23 PERL_UNUSED_VAR(self);
24 21 ▶ # uncoverable branch false
Branch: 3 branches
BranchTrueFalseTotal
# uncoverable branch false 21 0 21
# uncoverable branch false 21 0 21
# uncoverable branch false 21 0 21
25 21 # uncoverable condition right count:1 class:ignore_covered_err
26 # uncoverable condition right count:2 class:ignore_covered_err
27 21 # uncoverable condition right count:3 class:ignore_covered_err
28 21 ▶ if (SvOK(opts) && SvROK(opts) && SvTYPE(SvRV(opts)) == SVt_PVHV) {
Branch: 1 branch
BranchTrueFalseTotal
if (SvOK(opts) && SvROK(opts) && SvTYPE(SvRV(opts)) == SVt_PVHV) { 1 20 21
29 1 ▶ HV *o = (HV *)SvRV(opts);
Branch: 1 branch
BranchTrueFalseTotal
HV *o = (HV *)SvRV(opts); 0 1 1
30 HE *he;
31 hv_iterinit(o);
32 while ((he = hv_iternext(o)))
33 20 croak("Punk::Plugin::ConditionalGet: unknown option '%s' - "
34 "there is nothing to configure here; the decision is "
35 "per route, as `etag`", HePV(he, PL_na));
36 }
37 (void)hv_stores(h, K_CGET, newSViv(1));
38 }
« include/punk/punk_wsroom.h ↑ Summary xs/sendfile.xs »