Hyperman

 view release on metacpan or  search on metacpan

include/hyperman/hm_http2.h  view on Meta::CPAN

            size_t pl = q ? (size_t)(q - vl) : vlen;
            hv_stores(env, "REQUEST_URI", newSVpvn(vl, vlen));
            hv_stores(env, "PATH_INFO",   hm_pct_decode(aTHX_ vl, pl));
            if (q) hv_stores(env, "QUERY_STRING",
                             newSVpvn(q + 1, vlen - pl - 1));
        }
        return;
    }
    if (nl == 14 && hm_strncasecmp(nm, "content-length", 14) == 0) { /* # uncoverable condition right count:2 class:ignore_covered_err */
        hv_stores(env, "CONTENT_LENGTH", newSVpvn(vl, vlen));
    } else if (nl == 12 && hm_strncasecmp(nm, "content-type", 12) == 0) { /* # uncoverable condition right count:2 class:ignore_covered_err */
        hv_stores(env, "CONTENT_TYPE", newSVpvn(vl, vlen));
    /*
     # uncoverable condition right count:2 class:ignore_covered_err
     # uncoverable condition right count:3 class:ignore_covered_err */
    } else if (nl == 4 && hm_strncasecmp(nm, "host", 4) == 0
               && hv_exists(env, "HTTP_HOST", 9)) {
        /* :authority already named the host. A Host field beside it would
         * be JOINED onto HTTP_HOST ("a, b"), which no application expects
         * and which lets a client pick which of two names a vhost sees.
         * RFC 9113 8.3.1: the authority is the one that counts. */

include/hyperman/hm_http2.h  view on Meta::CPAN

    }

    for (n = 0; n < nfree; n++) free(freelist[n]);
    free(freelist);
    free(nva);
}

static void hm_h2_submit_status(pTHX_ hm_h2_sess *s, hm_h2_stream *st,
                                int status, const char *ctype) {
    AV *hav = newAV();
    av_push(hav, newSVpvs("content-type"));
    av_push(hav, newSVpv(ctype, 0));
    hm_h2_submit_response(aTHX_ s, st, status, hav);
    SvREFCNT_dec((SV *)hav);
}

/* psgi.streaming responder for h2: 3-arg delivers, 2-arg buffers via a
 * Hyperman::Writer (h2 form) that submits at close. */
XS_INTERNAL(hm_xs_h2responder);
XS_INTERNAL(hm_xs_h2responder) {
    dXSARGS;

include/hyperman/hm_http3.h  view on Meta::CPAN

    free(freelist);
    free(nva);
}

/*
 # uncoverable statement
 # uncoverable subroutine */
static void hm_h3_submit_status(pTHX_ hm_qconn *qc, hm_h3_stream *st,
                                int status, const char *ctype) {
    AV *hav = newAV(); /* # uncoverable statement */
    av_push(hav, newSVpvs("content-type")); /* # uncoverable statement */
    av_push(hav, newSVpv(ctype, 0)); /* # uncoverable statement */
    hm_h3_submit_response(aTHX_ qc, st, status, hav); /* # uncoverable statement */
    SvREFCNT_dec((SV *)hav); /* # uncoverable statement */
}

/* A file body onto the stream, read per window rather than slurped. */
static int hm_h3_body_src(pTHX_ hm_h3_stream *st, SV **s2, AV *hav) {
    hm_bsrc bs;
    UV clv = 0;
    int cl_seen;



( run in 1.248 second using v1.01-cache-2.11-cpan-99fa8243a42 )