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) {
        hv_stores(env, "CONTENT_LENGTH", newSVpvn(vl, vlen));
    } else if (nl == 12 && hm_strncasecmp(nm, "content-type", 12) == 0) {
        hv_stores(env, "CONTENT_TYPE", newSVpvn(vl, vlen));
    } else if (nl + 5 < 300) {
        char keybuf[300];
        size_t i;
        SV **old;
        memcpy(keybuf, "HTTP_", 5);
        for (i = 0; i < nl; i++) {
            unsigned char ch = (unsigned char)nm[i];
            if (ch >= 'a' && ch <= 'z') ch -= 32;
            else if (ch == '-') ch = '_';

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

    s->conn->loop->bytes_out += st->blen;

    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

     * the same bytes twice. */

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

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

/* 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 2.473 seconds using v1.01-cache-2.11-cpan-800906f7e73 )