Branch Coverage

Feersum.xs
Criterion Covered Total %
branch 607 1308 46.4


line true false branch
291 0 45 if (elt == NULL) return NULL;
294 4 41 if (unlikely(SvMAGICAL(sv))) sv = sv_2mortal(newSVsv(sv));
295 3 42 if (unlikely(!SvOK(sv))) return NULL;
3 0 if (unlikely(!SvOK(sv))) return NULL;
3 0 if (unlikely(!SvOK(sv))) return NULL;
3 0 if (unlikely(!SvOK(sv))) return NULL;
297 14 28 if (unlikely(SvROK(sv))) sv = SvRV(sv);
308 74 514 if (!c->wbuf_rinq) {
317 0 514 if (m->count >= FEERSUM_IOMATRIX_SIZE) {
322 74 514 if (add_iomatrix) {
342 2 252 if (unlikely(SvMAGICAL(sv))) {
345 0 252 else if (unlikely(SvPADTMP(sv))) {
350 0 0 if (SvFLAGS(sv) == (SVs_PADTMP|SVf_POK|SVp_POK)) {
360 0 0 (void)SvOK_off(sv);
380 245 9 m->iov[idx].iov_base = SvPV(sv, cur);
415 4 15 if (!c->is_http11) return; // nothing required
425 51 0 iov->iov_base = SvPV(sv,cur);
505 0 0 if (100 <= code && code <= 199) {
0 0 if (100 <= code && code <= 199) {
508 0 0 else if (200 <= code && code <= 299) {
0 0 else if (200 <= code && code <= 299) {
511 0 0 else if (300 <= code && code <= 399) {
0 0 else if (300 <= code && code <= 399) {
514 0 0 else if (400 <= code && code <= 499) {
0 0 else if (400 <= code && code <= 499) {
529 0 57 if (unlikely(fcntl(fd, F_SETFL, flags) < 0))
532 57 0 if (likely(is_tcp)) {
535 0 57 if (unlikely(setsockopt(fd, SOL_TCP, TCP_NODELAY, &flags, sizeof(int))))
541 0 57 if (unlikely(setsockopt(fd, SOL_SOCKET, SO_OOBINLINE, &flags, sizeof(int))))
546 0 57 if (unlikely(setsockopt(fd, SOL_SOCKET, SO_LINGER, &linger, sizeof(linger))))
555 49 57 if (unlikely(c->fd < 0))
561 0 57 if (unlikely(close(c->fd)))
571 57 0 SvUPGRADE(self, SVt_PVMG); // ensures sv_bless doesn't reallocate
572 57 0 SvGROW(self, sizeof(struct feer_conn));
57 0 SvGROW(self, sizeof(struct feer_conn));
609 0 139 if (unlikely(!sv_isa(rv,"Feersum::Connection")))
625 0 96 if (unlikely(!SvROK(rv))) croak("Expected a reference");
628 96 0 if (likely(
27 69 if (likely(
27 0 if (likely(
96 0 if (likely(
633 0 96 UV uv = SvUV(sv);
634 20 76 if (uv == 0) {
635 4 16 if (can_croak) croak("Operation not allowed: Handle is closed.");
641 0 0 if (can_croak)
652 18 6 sv_bless(sv, is_writer ? feer_conn_writer_stash : feer_conn_reader_stash);
688 3 57 if (unlikely(ev_is_active(&c->read_ev_io)))
697 12 57 if (unlikely(!ev_is_active(&c->read_ev_io)))
706 57 2 if (likely(!ev_is_active(&c->read_ev_timer))) {
716 12 57 if (unlikely(!ev_is_active(&c->read_ev_timer)))
725 20 63 if (unlikely(ev_is_active(&c->write_ev_io)))
734 0 63 if (unlikely(!ev_is_active(&c->write_ev_io)))
745 54 32 while (request_ready_rinq) {
752 43 11 if (likely(c->wbuf_rinq)) {
763 0 20 if (unlikely(revents & EV_ERROR)) {
769 20 0 if (!ev_is_active(&accept_w) && !shutting_down) {
20 0 if (!ev_is_active(&accept_w) && !shutting_down) {
778 0 241 if (unlikely(revents & EV_ERROR)) {
784 32 209 if (request_ready_rinq)
791 0 31 if (unlikely(revents & EV_ERROR)) {
797 0 31 if (request_ready_rinq)
813 0 74 if (unlikely(revents & EV_ERROR && !(revents & EV_WRITE))) {
0 0 if (unlikely(revents & EV_ERROR && !(revents & EV_WRITE))) {
819 15 59 if (unlikely(!c->wbuf_rinq)) {
820 0 15 if (unlikely(c->responding >= RESPOND_SHUTDOWN))
823 0 15 if (!c->poll_write_cb) {
825 0 0 if (c->responding == RESPOND_STREAMING)
833 11 4 if (c->poll_write_cb_is_io_handle)
839 0 15 if (unlikely(!c->wbuf_rinq)) goto try_write_again;
857 0 74 if (unlikely(wrote <= 0)) {
858 0 0 if (unlikely(wrote == 0))
860 0 0 if (likely(errno == EAGAIN || errno == EINTR))
0 0 if (likely(errno == EAGAIN || errno == EINTR))
867 588 74 for (i = m->offset; i < m->count && wrote > 0; i++) {
588 0 for (i = m->offset; i < m->count && wrote > 0; i++) {
869 0 588 if (unlikely(v->iov_len > wrote)) {
882 305 283 if (m->sv[i]) {
889 74 0 if (likely(m->offset >= m->count)) {
893 74 0 if (!c->wbuf_rinq)
917 11 14 if (c->poll_write_cb) goto try_write_again;
945 57 0 if (likely(!req)) {
969 0 58 if (unlikely(revents & EV_ERROR && !(revents & EV_READ))) {
0 0 if (unlikely(revents & EV_ERROR && !(revents & EV_READ))) {
974 0 58 if (unlikely(c->receiving == RECEIVE_SHUTDOWN))
979 57 1 if (likely(!c->rbuf)) { // likely = optimize for small requests
986 1 57 if (unlikely(space_free < READ_BUFSZ)) { // unlikely = optimize for small
990 1 0 SvGROW(c->rbuf, new_len);
1 0 SvGROW(c->rbuf, new_len);
997 0 58 if (unlikely(got_n <= 0)) {
998 0 0 if (unlikely(got_n == 0)) {
1002 0 0 if (likely(errno == EAGAIN || errno == EINTR))
0 0 if (likely(errno == EAGAIN || errno == EINTR))
1011 57 1 if (likely(c->receiving == RECEIVE_HEADERS)) {
1038 1 56 if (ret == -1) goto try_read_bad;
1039 1 55 if (ret == -2) goto try_read_again;
1041 1 54 if (process_request_headers(c, ret))
1046 1 0 else if (likely(c->receiving == RECEIVE_BODY)) {
1048 1 0 if (c->received_cl < c->expected_cl)
1098 2 0 if (unlikely(!(revents & EV_TIMER) || c->receiving == RECEIVE_SHUTDOWN)) {
0 2 if (unlikely(!(revents & EV_TIMER) || c->receiving == RECEIVE_SHUTDOWN)) {
1100 0 0 if (revents & EV_ERROR)
1108 2 0 if (likely(c->responding == RESPOND_NOT_STARTED)) {
1110 1 1 if (c->receiving == RECEIVE_HEADERS) {
1140 0 32 if (unlikely(shutting_down)) {
1147 0 32 if (unlikely(revents & EV_ERROR)) {
1161 32 57 if (fd == -1) break;
1165 0 57 if (unlikely(sa_buf.ss_family == AF_UNIX)) is_tcp = 0;
1169 0 57 if (unlikely(prep_socket(fd, is_tcp))) {
1192 32 22 if (!ev_is_active(&ei)) {
1214 48 7 if (likely(str_eq("GET", 3, req->method, req->method_len))) {
1220 0 7 else if (likely(str_eq("OPTIONS", 7, req->method, req->method_len))) {
1224 7 0 else if (likely(str_eq("POST", 4, req->method, req->method_len))) {
1227 0 0 else if (str_eq("PUT", 3, req->method, req->method_len)) {
1251 55 0 char *from = SvPV(c->rbuf,from_len);
1255 0 55 ? need : READ_INIT_FACTOR*READ_BUFSZ-1;
1257 15 40 SV *new_rbuf = newSVpvn(need ? from : "", need);
1263 48 7 if (likely(next_req_follows)) // optimize for GET
1269 14 0 for (i=0; i < req->num_headers; i++) {
1271 0 14 if (!hdr->name) continue;
1273 7 7 if (unlikely(
1277 7 0 if (likely(g == IS_NUMBER_IN_UV)) {
1278 0 7 if (unlikely(expected > MAX_BODY_LEN)) {
1296 0 0 if (body_is_required) {
1316 7 0 SvGROW(c->rbuf, c->expected_cl + 1);
0 7 SvGROW(c->rbuf, c->expected_cl + 1);
1320 7 0 if (unlikely(c->expected_cl && c->received_cl < c->expected_cl)) {
1 6 if (unlikely(c->expected_cl && c->received_cl < c->expected_cl)) {
1336 93 72 if (c->in_callback) return; // defer until out of callback
1338 49 23 if (c->write_ev_io.data == NULL) {
1357 0 4 if (unlikely(c->responding != RESPOND_NOT_STARTED)) {
1362 4 0 if (!msg_len) msg_len = strlen(msg);
1387 14 55 if (a_len != b_len) return 0;
1388 0 55 if (a == b) return 1;
1390 172 55 for (i=0; i
172 0 for (i=0; i
1391 0 172 if (a[i] != b[i]) return 0;
1402 400 24 if (a_len != b_len) return 0;
1403 0 24 if (a == b) return 1;
1405 285 21 for (i=0; i
285 0 for (i=0; i
1406 3 282 if (a[i] != tolower(b[i])) return 0;
1414 16 2 if (likely('0' <= ch && ch <= '9'))
14 2 if (likely('0' <= ch && ch <= '9'))
1416 2 2 else if ('A' <= ch && ch <= 'F')
1 1 else if ('A' <= ch && ch <= 'F')
1418 1 2 else if ('a' <= ch && ch <= 'f')
1 0 else if ('a' <= ch && ch <= 'f')
1429 45 0 ptr = SvPV(sv, len);
1433 136 42 while (ptr < end) {
1434 3 133 if (unlikely(*ptr == '%')) goto needs_decode;
1445 28 3 for (; ptr < end; ptr++) {
1446 9 19 if (unlikely(*ptr == '%') && likely(end - ptr >= 2)) {
9 0 if (unlikely(*ptr == '%') && likely(end - ptr >= 2)) {
1449 8 1 if (likely(c1 != -1 && c2 != -1)) {
7 1 if (likely(c1 != -1 && c2 != -1)) {
1460 3 0 ptr = SvPV_nolen(sv);
1528 15 30 if (unlikely(!feersum_tmpl_env))
1540 42 3 hv_stores(e, "SERVER_PROTOCOL", (r->minor_version == 1) ?
1548 45 0 if (c->sa->sa_family == AF_INET) {
1555 0 0 else if (c->sa->sa_family == AF_INET6) {
1563 0 0 else if (c->sa->sa_family == AF_UNIX) {
1571 45 0 if (likely(str_addr)) {
1579 6 39 if (unlikely(c->expected_cl > 0)) {
1587 19 26 if (request_cb_is_psgi) {
1599 214 6 while (*qpos != '?' && qpos < r->path + r->path_len)
175 39 while (*qpos != '?' && qpos < r->path + r->path_len)
1602 6 39 if (*qpos == '?') {
1613 6 39 if (qstr != NULL) // hv template defaults QUERY_STRING to empty
1623 175 45 for (i=0; inum_headers; i++) {
1625 0 175 if (unlikely(hdr->name == NULL && val != NULL)) {
0 0 if (unlikely(hdr->name == NULL && val != NULL)) {
1630 6 169 else if (unlikely(str_case_eq(
1637 6 163 else if (unlikely(str_case_eq(
1645 0 163 if (kbuflen < klen) {
1650 1308 163 for (j=0; jname_len; j++) {
1652 1230 78 *key++ = (n == '-') ? '_' : toupper(n);
1660 0 163 if (unlikely(SvPOK(*val))) {
1685 0 45 if (unlikely(c->responding != RESPOND_NOT_STARTED))
1687 19 26 change_responding_state(c, streaming ? RESPOND_STREAMING : RESPOND_NORMAL);
1689 0 45 if (unlikely(!SvOK(message) || !(SvIOK(message) || SvPOK(message)))) {
0 0 if (unlikely(!SvOK(message) || !(SvIOK(message) || SvPOK(message)))) {
0 0 if (unlikely(!SvOK(message) || !(SvIOK(message) || SvPOK(message)))) {
0 0 if (unlikely(!SvOK(message) || !(SvIOK(message) || SvPOK(message)))) {
45 0 if (unlikely(!SvOK(message) || !(SvIOK(message) || SvPOK(message)))) {
21 24 if (unlikely(!SvOK(message) || !(SvIOK(message) || SvPOK(message)))) {
0 21 if (unlikely(!SvOK(message) || !(SvIOK(message) || SvPOK(message)))) {
0 45 if (unlikely(!SvOK(message) || !(SvIOK(message) || SvPOK(message)))) {
1694 0 45 if (unlikely(avl+1 % 2 == 1)) {
1700 24 21 if (SvIOK(message))
1701 24 0 code = SvIV(message);
1702 0 21 else if (SvUOK(message))
1703 0 0 code = SvUV(message);
1706 0 21 if (unlikely(numtype != IS_NUMBER_IN_UV))
1711 0 45 if (unlikely(!code))
1715 21 24 if (likely(!SvPOK(message) || SvCUR(message) == 3)) {
1 20 if (likely(!SvPOK(message) || SvCUR(message) == 3)) {
1721 43 2 c->auto_cl = (code == 304 || (100 <= code && code <= 199)) ? 0 : 1;
43 0 c->auto_cl = (code == 304 || (100 <= code && code <= 199)) ? 0 : 1;
43 0 c->auto_cl = (code == 304 || (100 <= code && code <= 199)) ? 0 : 1;
1723 41 4 add_const_to_wbuf(c, c->is_http11 ? "HTTP/1.1 " : "HTTP/1.0 ", 9);
1727 67 45 for (i=0; i
1729 67 0 if (unlikely(!hdr || !SvOK(*hdr))) {
0 67 if (unlikely(!hdr || !SvOK(*hdr))) {
0 0 if (unlikely(!hdr || !SvOK(*hdr))) {
0 0 if (unlikely(!hdr || !SvOK(*hdr))) {
0 0 if (unlikely(!hdr || !SvOK(*hdr))) {
0 67 if (unlikely(!hdr || !SvOK(*hdr))) {
1735 67 0 if (unlikely(!val || !SvOK(*val))) {
0 67 if (unlikely(!val || !SvOK(*val))) {
0 0 if (unlikely(!val || !SvOK(*val))) {
0 0 if (unlikely(!val || !SvOK(*val))) {
0 0 if (unlikely(!val || !SvOK(*val))) {
0 67 if (unlikely(!val || !SvOK(*val))) {
1741 67 0 const char *hp = SvPV(*hdr, hlen);
1755 19 26 if (streaming) {
1756 15 4 if (c->is_http11)
1773 0 26 if (c->responding != RESPOND_NORMAL)
1776 0 26 if (!SvOK(body)) {
0 0 if (!SvOK(body)) {
0 0 if (!SvOK(body)) {
1780 23 3 else if (SvROK(body)) {
1782 21 2 if (SvOK(refd) && !SvROK(refd)) {
21 0 if (SvOK(refd) && !SvROK(refd)) {
0 21 if (SvOK(refd) && !SvROK(refd)) {
2 0 if (SvOK(refd) && !SvROK(refd)) {
1786 0 21 else if (SvTYPE(refd) != SVt_PVAV) {
1796 24 2 if (likely(c->auto_cl))
1801 5 21 if (body_is_string) {
1809 35 21 for (i=0; i<=amax; i++) {
1811 1 34 if (unlikely(!sv)) continue;
1818 24 2 if (likely(c->auto_cl)) {
1834 0 13 PUSHMARK(SP);
1835 0 13 mXPUSHs(feer_conn_2sv(c));
1836 0 13 XPUSHs(streamer);
1840 13 0 if (unlikely(SvTRUE(ERRSV))) {
13 0 if (unlikely(SvTRUE(ERRSV))) {
13 0 if (unlikely(SvTRUE(ERRSV))) {
13 0 if (unlikely(SvTRUE(ERRSV))) {
0 13 if (unlikely(SvTRUE(ERRSV))) {
0 0 if (unlikely(SvTRUE(ERRSV))) {
13 0 if (unlikely(SvTRUE(ERRSV))) {
0 13 if (unlikely(SvTRUE(ERRSV))) {
0 0 if (unlikely(SvTRUE(ERRSV))) {
0 0 if (unlikely(SvTRUE(ERRSV))) {
0 0 if (unlikely(SvTRUE(ERRSV))) {
0 0 if (unlikely(SvTRUE(ERRSV))) {
13 0 if (unlikely(SvTRUE(ERRSV))) {
13 0 if (unlikely(SvTRUE(ERRSV))) {
13 0 if (unlikely(SvTRUE(ERRSV))) {
13 0 if (unlikely(SvTRUE(ERRSV))) {
13 0 if (unlikely(SvTRUE(ERRSV))) {
13 0 if (unlikely(SvTRUE(ERRSV))) {
13 0 if (unlikely(SvTRUE(ERRSV))) {
0 13 if (unlikely(SvTRUE(ERRSV))) {
0 0 if (unlikely(SvTRUE(ERRSV))) {
0 0 if (unlikely(SvTRUE(ERRSV))) {
0 0 if (unlikely(SvTRUE(ERRSV))) {
0 0 if (unlikely(SvTRUE(ERRSV))) {
0 0 if (unlikely(SvTRUE(ERRSV))) {
0 0 if (unlikely(SvTRUE(ERRSV))) {
0 0 if (unlikely(SvTRUE(ERRSV))) {
0 0 if (unlikely(SvTRUE(ERRSV))) {
0 0 if (unlikely(SvTRUE(ERRSV))) {
0 0 if (unlikely(SvTRUE(ERRSV))) {
0 0 if (unlikely(SvTRUE(ERRSV))) {
0 0 if (unlikely(SvTRUE(ERRSV))) {
0 0 if (unlikely(SvTRUE(ERRSV))) {
0 13 if (unlikely(SvTRUE(ERRSV))) {
1844 13 0 FREETMPS;
1852 0 22 if (unlikely(!SvOK(ret) || !SvROK(ret))) {
0 0 if (unlikely(!SvOK(ret) || !SvROK(ret))) {
0 0 if (unlikely(!SvOK(ret) || !SvROK(ret))) {
0 0 if (unlikely(!SvOK(ret) || !SvROK(ret))) {
22 0 if (unlikely(!SvOK(ret) || !SvROK(ret))) {
0 22 if (unlikely(!SvOK(ret) || !SvROK(ret))) {
1853 0 0 sv_setpvs(ERRSV, "Invalid PSGI response (expected reference)");
1858 0 22 if (SvOK(ret) && unlikely(!IsArrayRef(ret))) {
0 0 if (SvOK(ret) && unlikely(!IsArrayRef(ret))) {
0 0 if (SvOK(ret) && unlikely(!IsArrayRef(ret))) {
22 0 if (SvOK(ret) && unlikely(!IsArrayRef(ret))) {
13 9 if (SvOK(ret) && unlikely(!IsArrayRef(ret))) {
1859 13 0 if (likely(can_recurse)) {
1864 0 0 sv_setpvs(ERRSV, "PSGI attempt to recurse in a streaming callback");
1871 0 9 if (unlikely(av_len(psgi_triplet)+1 != 3)) {
1872 0 0 sv_setpvs(ERRSV, "Invalid PSGI array response (expected triplet)");
1884 9 0 if (IsArrayRef(hdrs))
9 0 if (IsArrayRef(hdrs))
1887 0 0 sv_setpvs(ERRSV, "PSGI Headers must be an array-ref");
1892 9 0 if (likely(IsArrayRef(body))) {
4 5 if (likely(IsArrayRef(body))) {
1896 5 0 else if (likely(SvROK(body))) { // probaby an IO::Handle-like object
1903 0 0 sv_setpvs(ERRSV, "Expected PSGI array-ref or IO::Handle-like body");
1913 18 4 if (is_writer) {
1915 0 18 if (c->poll_write_cb) {
1919 14 4 if (c->responding < RESPOND_SHUTDOWN) {
1929 1 3 if (c->rbuf) {
1945 4 2 if (guard) {
1946 2 2 if (c->ext_guard) SvREFCNT_dec(c->ext_guard);
1947 0 4 c->ext_guard = SvOK(guard) ? newSVsv(guard) : NULL;
0 0 c->ext_guard = SvOK(guard) ? newSVsv(guard) : NULL;
0 0 c->ext_guard = SvOK(guard) ? newSVsv(guard) : NULL;
1949 6 0 return c->ext_guard ? newSVsv(c->ext_guard) : &PL_sv_undef;
1959 0 1 PUSHMARK(SP);
1960 0 1 mXPUSHs(newSVsv(ERRSV));
1 0 mXPUSHs(newSVsv(ERRSV));
1966 1 0 sv_setsv(ERRSV, &PL_sv_undef);
1982 0 54 PUSHMARK(SP);
1984 19 35 if (request_cb_is_psgi) {
1986 0 19 mXPUSHs(newRV_noinc((SV*)env));
1990 0 35 mXPUSHs(feer_conn_2sv(c));
2000 54 0 if (unlikely(SvTRUE(ERRSV))) {
54 0 if (unlikely(SvTRUE(ERRSV))) {
54 0 if (unlikely(SvTRUE(ERRSV))) {
54 0 if (unlikely(SvTRUE(ERRSV))) {
0 54 if (unlikely(SvTRUE(ERRSV))) {
0 0 if (unlikely(SvTRUE(ERRSV))) {
54 0 if (unlikely(SvTRUE(ERRSV))) {
0 54 if (unlikely(SvTRUE(ERRSV))) {
0 0 if (unlikely(SvTRUE(ERRSV))) {
0 0 if (unlikely(SvTRUE(ERRSV))) {
0 0 if (unlikely(SvTRUE(ERRSV))) {
0 0 if (unlikely(SvTRUE(ERRSV))) {
54 0 if (unlikely(SvTRUE(ERRSV))) {
54 0 if (unlikely(SvTRUE(ERRSV))) {
54 0 if (unlikely(SvTRUE(ERRSV))) {
54 0 if (unlikely(SvTRUE(ERRSV))) {
54 0 if (unlikely(SvTRUE(ERRSV))) {
53 1 if (unlikely(SvTRUE(ERRSV))) {
53 0 if (unlikely(SvTRUE(ERRSV))) {
0 53 if (unlikely(SvTRUE(ERRSV))) {
0 0 if (unlikely(SvTRUE(ERRSV))) {
0 0 if (unlikely(SvTRUE(ERRSV))) {
0 0 if (unlikely(SvTRUE(ERRSV))) {
0 0 if (unlikely(SvTRUE(ERRSV))) {
0 0 if (unlikely(SvTRUE(ERRSV))) {
0 0 if (unlikely(SvTRUE(ERRSV))) {
0 0 if (unlikely(SvTRUE(ERRSV))) {
0 0 if (unlikely(SvTRUE(ERRSV))) {
0 0 if (unlikely(SvTRUE(ERRSV))) {
0 0 if (unlikely(SvTRUE(ERRSV))) {
0 0 if (unlikely(SvTRUE(ERRSV))) {
0 0 if (unlikely(SvTRUE(ERRSV))) {
0 0 if (unlikely(SvTRUE(ERRSV))) {
1 53 if (unlikely(SvTRUE(ERRSV))) {
2006 19 35 if (request_cb_is_psgi && likely(returned >= 1)) {
19 0 if (request_cb_is_psgi && likely(returned >= 1)) {
2014 19 35 if (request_cb_is_psgi && likely(returned >= 1)) {
19 0 if (request_cb_is_psgi && likely(returned >= 1)) {
2020 19 35 if (request_cb_is_psgi && c->expected_cl > 0) {
0 19 if (request_cb_is_psgi && c->expected_cl > 0) {
2028 54 0 FREETMPS;
2038 4 0 SV *cb = (is_write) ? c->poll_write_cb : NULL;
2040 0 4 if (unlikely(cb == NULL)) return;
2049 0 4 PUSHMARK(SP);
2050 0 4 mXPUSHs(new_feer_conn_handle(aTHX_ c, is_write));
2058 4 0 if (unlikely(SvTRUE(ERRSV))) {
4 0 if (unlikely(SvTRUE(ERRSV))) {
4 0 if (unlikely(SvTRUE(ERRSV))) {
4 0 if (unlikely(SvTRUE(ERRSV))) {
0 4 if (unlikely(SvTRUE(ERRSV))) {
0 0 if (unlikely(SvTRUE(ERRSV))) {
4 0 if (unlikely(SvTRUE(ERRSV))) {
0 4 if (unlikely(SvTRUE(ERRSV))) {
0 0 if (unlikely(SvTRUE(ERRSV))) {
0 0 if (unlikely(SvTRUE(ERRSV))) {
0 0 if (unlikely(SvTRUE(ERRSV))) {
0 0 if (unlikely(SvTRUE(ERRSV))) {
4 0 if (unlikely(SvTRUE(ERRSV))) {
4 0 if (unlikely(SvTRUE(ERRSV))) {
4 0 if (unlikely(SvTRUE(ERRSV))) {
4 0 if (unlikely(SvTRUE(ERRSV))) {
4 0 if (unlikely(SvTRUE(ERRSV))) {
4 0 if (unlikely(SvTRUE(ERRSV))) {
4 0 if (unlikely(SvTRUE(ERRSV))) {
0 4 if (unlikely(SvTRUE(ERRSV))) {
0 0 if (unlikely(SvTRUE(ERRSV))) {
0 0 if (unlikely(SvTRUE(ERRSV))) {
0 0 if (unlikely(SvTRUE(ERRSV))) {
0 0 if (unlikely(SvTRUE(ERRSV))) {
0 0 if (unlikely(SvTRUE(ERRSV))) {
0 0 if (unlikely(SvTRUE(ERRSV))) {
0 0 if (unlikely(SvTRUE(ERRSV))) {
0 0 if (unlikely(SvTRUE(ERRSV))) {
0 0 if (unlikely(SvTRUE(ERRSV))) {
0 0 if (unlikely(SvTRUE(ERRSV))) {
0 0 if (unlikely(SvTRUE(ERRSV))) {
0 0 if (unlikely(SvTRUE(ERRSV))) {
0 0 if (unlikely(SvTRUE(ERRSV))) {
0 4 if (unlikely(SvTRUE(ERRSV))) {
2059 0 0 call_died(aTHX_ c, is_write ? "write poll" : "read poll");
2064 4 0 FREETMPS;
2076 0 11 if (unlikely(io == NULL)) return;
2090 0 11 PUSHMARK(SP);
2091 0 11 XPUSHs(c->poll_write_cb);
2099 11 0 if (unlikely(SvTRUE(ERRSV))) {
11 0 if (unlikely(SvTRUE(ERRSV))) {
11 0 if (unlikely(SvTRUE(ERRSV))) {
11 0 if (unlikely(SvTRUE(ERRSV))) {
0 11 if (unlikely(SvTRUE(ERRSV))) {
0 0 if (unlikely(SvTRUE(ERRSV))) {
11 0 if (unlikely(SvTRUE(ERRSV))) {
0 11 if (unlikely(SvTRUE(ERRSV))) {
0 0 if (unlikely(SvTRUE(ERRSV))) {
0 0 if (unlikely(SvTRUE(ERRSV))) {
0 0 if (unlikely(SvTRUE(ERRSV))) {
0 0 if (unlikely(SvTRUE(ERRSV))) {
11 0 if (unlikely(SvTRUE(ERRSV))) {
11 0 if (unlikely(SvTRUE(ERRSV))) {
11 0 if (unlikely(SvTRUE(ERRSV))) {
11 0 if (unlikely(SvTRUE(ERRSV))) {
11 0 if (unlikely(SvTRUE(ERRSV))) {
11 0 if (unlikely(SvTRUE(ERRSV))) {
11 0 if (unlikely(SvTRUE(ERRSV))) {
0 11 if (unlikely(SvTRUE(ERRSV))) {
0 0 if (unlikely(SvTRUE(ERRSV))) {
0 0 if (unlikely(SvTRUE(ERRSV))) {
0 0 if (unlikely(SvTRUE(ERRSV))) {
0 0 if (unlikely(SvTRUE(ERRSV))) {
0 0 if (unlikely(SvTRUE(ERRSV))) {
0 0 if (unlikely(SvTRUE(ERRSV))) {
0 0 if (unlikely(SvTRUE(ERRSV))) {
0 0 if (unlikely(SvTRUE(ERRSV))) {
0 0 if (unlikely(SvTRUE(ERRSV))) {
0 0 if (unlikely(SvTRUE(ERRSV))) {
0 0 if (unlikely(SvTRUE(ERRSV))) {
0 0 if (unlikely(SvTRUE(ERRSV))) {
0 0 if (unlikely(SvTRUE(ERRSV))) {
0 11 if (unlikely(SvTRUE(ERRSV))) {
2105 11 0 if (returned > 0)
2107 11 0 if (ret && SvMAGICAL(ret))
0 11 if (ret && SvMAGICAL(ret))
2110 11 0 if (unlikely(!ret || !SvOK(ret))) {
5 6 if (unlikely(!ret || !SvOK(ret))) {
5 0 if (unlikely(!ret || !SvOK(ret))) {
5 0 if (unlikely(!ret || !SvOK(ret))) {
5 0 if (unlikely(!ret || !SvOK(ret))) {
5 6 if (unlikely(!ret || !SvOK(ret))) {
2112 0 5 PUSHMARK(SP);
2113 0 5 XPUSHs(c->poll_write_cb);
2118 5 0 if (unlikely(SvTRUE(ERRSV))) {
5 0 if (unlikely(SvTRUE(ERRSV))) {
5 0 if (unlikely(SvTRUE(ERRSV))) {
5 0 if (unlikely(SvTRUE(ERRSV))) {
0 5 if (unlikely(SvTRUE(ERRSV))) {
0 0 if (unlikely(SvTRUE(ERRSV))) {
5 0 if (unlikely(SvTRUE(ERRSV))) {
0 5 if (unlikely(SvTRUE(ERRSV))) {
0 0 if (unlikely(SvTRUE(ERRSV))) {
0 0 if (unlikely(SvTRUE(ERRSV))) {
0 0 if (unlikely(SvTRUE(ERRSV))) {
0 0 if (unlikely(SvTRUE(ERRSV))) {
5 0 if (unlikely(SvTRUE(ERRSV))) {
5 0 if (unlikely(SvTRUE(ERRSV))) {
5 0 if (unlikely(SvTRUE(ERRSV))) {
5 0 if (unlikely(SvTRUE(ERRSV))) {
5 0 if (unlikely(SvTRUE(ERRSV))) {
5 0 if (unlikely(SvTRUE(ERRSV))) {
5 0 if (unlikely(SvTRUE(ERRSV))) {
0 5 if (unlikely(SvTRUE(ERRSV))) {
0 0 if (unlikely(SvTRUE(ERRSV))) {
0 0 if (unlikely(SvTRUE(ERRSV))) {
0 0 if (unlikely(SvTRUE(ERRSV))) {
0 0 if (unlikely(SvTRUE(ERRSV))) {
0 0 if (unlikely(SvTRUE(ERRSV))) {
0 0 if (unlikely(SvTRUE(ERRSV))) {
0 0 if (unlikely(SvTRUE(ERRSV))) {
0 0 if (unlikely(SvTRUE(ERRSV))) {
0 0 if (unlikely(SvTRUE(ERRSV))) {
0 0 if (unlikely(SvTRUE(ERRSV))) {
0 0 if (unlikely(SvTRUE(ERRSV))) {
0 0 if (unlikely(SvTRUE(ERRSV))) {
0 0 if (unlikely(SvTRUE(ERRSV))) {
0 5 if (unlikely(SvTRUE(ERRSV))) {
2119 0 0 trouble("Couldn't close body IO handle: %-p",ERRSV);
2130 6 0 if (c->is_http11)
2139 11 0 FREETMPS;
2161 0 8 PUSHMARK(SP);
2162 0 8 XPUSHs(sv);
2163 0 8 mXPUSHs(newSViv(c->fd));
2169 8 0 if (unlikely(SvTRUE(ERRSV))) {
8 0 if (unlikely(SvTRUE(ERRSV))) {
8 0 if (unlikely(SvTRUE(ERRSV))) {
0 8 if (unlikely(SvTRUE(ERRSV))) {
0 0 if (unlikely(SvTRUE(ERRSV))) {
8 0 if (unlikely(SvTRUE(ERRSV))) {
0 8 if (unlikely(SvTRUE(ERRSV))) {
0 0 if (unlikely(SvTRUE(ERRSV))) {
0 0 if (unlikely(SvTRUE(ERRSV))) {
0 0 if (unlikely(SvTRUE(ERRSV))) {
0 0 if (unlikely(SvTRUE(ERRSV))) {
8 0 if (unlikely(SvTRUE(ERRSV))) {
8 0 if (unlikely(SvTRUE(ERRSV))) {
8 0 if (unlikely(SvTRUE(ERRSV))) {
8 0 if (unlikely(SvTRUE(ERRSV))) {
8 0 if (unlikely(SvTRUE(ERRSV))) {
8 0 if (unlikely(SvTRUE(ERRSV))) {
8 0 if (unlikely(SvTRUE(ERRSV))) {
0 8 if (unlikely(SvTRUE(ERRSV))) {
0 0 if (unlikely(SvTRUE(ERRSV))) {
0 0 if (unlikely(SvTRUE(ERRSV))) {
0 0 if (unlikely(SvTRUE(ERRSV))) {
0 0 if (unlikely(SvTRUE(ERRSV))) {
0 0 if (unlikely(SvTRUE(ERRSV))) {
0 0 if (unlikely(SvTRUE(ERRSV))) {
0 0 if (unlikely(SvTRUE(ERRSV))) {
0 0 if (unlikely(SvTRUE(ERRSV))) {
0 0 if (unlikely(SvTRUE(ERRSV))) {
0 0 if (unlikely(SvTRUE(ERRSV))) {
0 0 if (unlikely(SvTRUE(ERRSV))) {
0 0 if (unlikely(SvTRUE(ERRSV))) {
0 0 if (unlikely(SvTRUE(ERRSV))) {
0 8 if (unlikely(SvTRUE(ERRSV))) {
2181 8 0 if (likely(c->rbuf && SvOK(c->rbuf) && SvCUR(c->rbuf))) {
0 8 if (likely(c->rbuf && SvOK(c->rbuf) && SvCUR(c->rbuf))) {
0 0 if (likely(c->rbuf && SvOK(c->rbuf) && SvCUR(c->rbuf))) {
0 0 if (likely(c->rbuf && SvOK(c->rbuf) && SvCUR(c->rbuf))) {
0 0 if (likely(c->rbuf && SvOK(c->rbuf) && SvCUR(c->rbuf))) {
8 0 if (likely(c->rbuf && SvOK(c->rbuf) && SvCUR(c->rbuf))) {
8 0 if (likely(c->rbuf && SvOK(c->rbuf) && SvCUR(c->rbuf))) {
8 0 if (likely(c->rbuf && SvOK(c->rbuf) && SvCUR(c->rbuf))) {
2183 8 0 const char *rbuf_ptr = SvPV(c->rbuf, rbuf_len);
2196 8 0 FREETMPS;
2209 0 21 if (feer_server_name)
2214 0 21 if (feer_server_port)
2258 0 28 if (unlikely(!SvOK(cb) || !SvROK(cb)))
0 0 if (unlikely(!SvOK(cb) || !SvROK(cb)))
0 0 if (unlikely(!SvOK(cb) || !SvROK(cb)))
0 0 if (unlikely(!SvOK(cb) || !SvROK(cb)))
28 0 if (unlikely(!SvOK(cb) || !SvROK(cb)))
0 28 if (unlikely(!SvOK(cb) || !SvROK(cb)))
2260 7 21 if (request_cb_cv)
2273 2 0 if (!IsCodeRef(cb))
0 2 if (!IsCodeRef(cb))
2275 0 2 if (unlikely(shutting_down))
2284 1 1 if (active_conns <= 0) {
2289 0 1 PUSHMARK(SP);
2295 0 0 FREETMPS;
2305 7 6 if (items <= 1) {
2308 6 0 else if (items == 2) {
2310 2 4 NV new_read_timeout = SvNV(duration);
2311 3 3 if (!(new_read_timeout > 0.0)) {
2325 21 0 if (request_cb_cv)
2349 8 16 if (hdl == NULL) {
2357 6 2 if (ix == 2) // only close the writer on destruction
2373 2 8 if (unlikely(items == 4) && SvOK(ST(3)) && SvIOK(ST(3)))
0 2 if (unlikely(items == 4) && SvOK(ST(3)) && SvIOK(ST(3)))
0 0 if (unlikely(items == 4) && SvOK(ST(3)) && SvIOK(ST(3)))
0 0 if (unlikely(items == 4) && SvOK(ST(3)) && SvIOK(ST(3)))
2 0 if (unlikely(items == 4) && SvOK(ST(3)) && SvIOK(ST(3)))
2374 2 0 offset = SvIV(ST(3));
2381 0 10 if (unlikely(c->receiving <= RECEIVE_HEADERS))
2385 4 6 if (!SvOK(buf) || !SvPOK(buf)) {
4 0 if (!SvOK(buf) || !SvPOK(buf)) {
0 4 if (!SvOK(buf) || !SvPOK(buf)) {
0 6 if (!SvOK(buf) || !SvPOK(buf)) {
2388 4 0 SvGROW(buf, len+1);
1 3 SvGROW(buf, len+1);
2391 0 10 if (unlikely(SvREADONLY(buf)))
2394 0 10 if (unlikely(len == 0))
2397 10 0 buf_ptr = SvPV(buf, buf_len);
2398 8 2 if (likely(c->rbuf))
2399 8 0 src_ptr = SvPV(c->rbuf, src_len);
2404 1 9 if (unlikely(offset < 0))
2405 1 0 offset = (-offset >= c->received_cl) ? 0 : c->received_cl + offset;
2407 4 6 if (unlikely(len + offset > src_len))
2413 8 2 if (unlikely(!c->rbuf || src_len == 0 || offset >= c->received_cl)) {
0 8 if (unlikely(!c->rbuf || src_len == 0 || offset >= c->received_cl)) {
8 2 if (unlikely(!c->rbuf || src_len == 0 || offset >= c->received_cl)) {
0 8 if (unlikely(!c->rbuf || src_len == 0 || offset >= c->received_cl)) {
2415 2 0 if (c->receiving == RECEIVE_SHUTDOWN) {
2424 3 5 if (likely(len == src_len && offset == 0)) {
3 0 if (likely(len == src_len && offset == 0)) {
2427 1 2 if (likely(buf_len == 0)) {
2439 5 0 SvGROW(buf, SvCUR(buf) + len);
0 5 SvGROW(buf, SvCUR(buf) + len);
2441 3 2 if (likely(items == 3)) {
2455 0 22 if (unlikely(c->responding != RESPOND_STREAMING))
2458 22 0 SV *body = (items == 2) ? ST(1) : &PL_sv_undef;
2459 22 0 if (unlikely(!body || !SvOK(body)))
0 22 if (unlikely(!body || !SvOK(body)))
0 0 if (unlikely(!body || !SvOK(body)))
0 0 if (unlikely(!body || !SvOK(body)))
0 0 if (unlikely(!body || !SvOK(body)))
0 22 if (unlikely(!body || !SvOK(body)))
2463 0 22 if (SvROK(body)) {
2465 0 0 if (SvOK(refd) && SvPOK(refd)) {
0 0 if (SvOK(refd) && SvPOK(refd)) {
0 0 if (SvOK(refd) && SvPOK(refd)) {
0 0 if (SvOK(refd) && SvPOK(refd)) {
2472 22 0 (void)SvPV(body, RETVAL);
2474 13 9 if (c->is_http11)
2489 0 2 if (unlikely(c->responding != RESPOND_STREAMING))
2496 2 0 if (c->is_http11) {
2497 10 2 for (i=0; i<=amax; i++) {
2499 8 2 if (likely(sv)) add_chunk_sv_to_wbuf(c, sv);
2503 0 0 for (i=0; i<=amax; i++) {
2505 0 0 if (likely(sv)) add_sv_to_wbuf(c, sv);
2518 7 0 if (items == 3 && SvOK(ST(2)) && SvIOK(ST(2)))
0 7 if (items == 3 && SvOK(ST(2)) && SvIOK(ST(2)))
0 0 if (items == 3 && SvOK(ST(2)) && SvIOK(ST(2)))
0 0 if (items == 3 && SvOK(ST(2)) && SvIOK(ST(2)))
7 0 if (items == 3 && SvOK(ST(2)) && SvIOK(ST(2)))
2519 7 0 whence = SvIV(ST(2));
2523 0 7 if (unlikely(!c->rbuf)) {
2527 1 6 else if (offset == 0) {
2530 2 4 else if (offset > 0 && (whence == SEEK_CUR || whence == SEEK_SET)) {
1 1 else if (offset > 0 && (whence == SEEK_CUR || whence == SEEK_SET)) {
1 0 else if (offset > 0 && (whence == SEEK_CUR || whence == SEEK_SET)) {
2532 2 0 const char *str = SvPV_const(c->rbuf, len);
2533 0 2 if (offset > len)
2538 4 0 else if (offset < 0 && whence == SEEK_END) {
2 2 else if (offset < 0 && whence == SEEK_END) {
2540 2 0 const char *str = SvPV_const(c->rbuf, len);
2542 0 2 if (offset == 0) {
2545 1 1 else if (offset > 0) {
2585 8 0 if (unlikely(ix < 1 || ix > 2))
0 8 if (unlikely(ix < 1 || ix > 2))
2587 0 8 else if (unlikely(ix == 1))
2590 4 4 if (c->poll_write_cb != NULL) {
2595 4 4 if (!SvOK(cb)) {
4 0 if (!SvOK(cb)) {
4 0 if (!SvOK(cb)) {
2599 4 0 else if (unlikely(!IsCodeRef(cb)))
0 4 else if (unlikely(!IsCodeRef(cb)))
2610 2 1 RETVAL = feersum_conn_guard(aTHX_ c, (items==2) ? ST(1) : NULL);
2632 0 22 if (unlikely(!SvOK(body)))
0 0 if (unlikely(!SvOK(body)))
0 0 if (unlikely(!SvOK(body)))
0 0 if (unlikely(!SvOK(body)))
2646 5 0 if (IsArrayRef(psgi_response)) {
5 0 if (IsArrayRef(psgi_response)) {
2651 3 2 if (len == 3) {
2656 2 0 else if (len == 2) {
2659 2 0 if (unlikely(!IsArrayRef(headers)))
0 2 if (unlikely(!IsArrayRef(headers)))
2698 2 1 RETVAL = feersum_conn_guard(aTHX_ c, (items == 2) ? ST(1) : NULL);
2709 53 4 if (likely(c->rbuf)) SvREFCNT_dec(c->rbuf);
2711 0 57 if (c->wbuf_rinq) {
2713 0 0 while ((m = (struct iomatrix *)rinq_shift(&c->wbuf_rinq)) != NULL) {
2714 0 0 for (i=0; i < m->count; i++) {
2715 0 0 if (m->sv[i]) SvREFCNT_dec(m->sv[i]);
2721 57 0 if (likely(c->req)) {
2722 55 2 if (c->req->buf) SvREFCNT_dec(c->req->buf);
2726 57 0 if (likely(c->sa)) free(c->sa);
2730 0 57 if (c->poll_write_cb) SvREFCNT_dec(c->poll_write_cb);
2732 2 55 if (c->ext_guard) SvREFCNT_dec(c->ext_guard);
2736 3 54 if (unlikely(shutting_down && active_conns <= 0)) {
1 2 if (unlikely(shutting_down && active_conns <= 0)) {
2742 1 0 if (shutdown_cb_cv) {
2743 0 1 PUSHMARK(SP);
2761 0 22 I_EV_API("Feersum");
22 0 I_EV_API("Feersum");
22 0 I_EV_API("Feersum");
0 22 I_EV_API("Feersum");