Branch Coverage

Feersum.xs
Criterion Covered Total %
branch 620 1308 47.4


line true false branch
291 0 101 if (elt == NULL) return NULL;
294 4 97 if (unlikely(SvMAGICAL(sv))) sv = sv_2mortal(newSVsv(sv));
295 3 98 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 84 if (unlikely(SvROK(sv))) sv = SvRV(sv);
308 156 1037 if (!c->wbuf_rinq) {
317 0 1037 if (m->count >= FEERSUM_IOMATRIX_SIZE) {
322 156 1037 if (add_iomatrix) {
342 2 515 if (unlikely(SvMAGICAL(sv))) {
345 0 515 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 498 19 m->iov[idx].iov_base = SvPV(sv, cur);
415 4 24 if (!c->is_http11) return; // nothing required
425 115 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 118 if (unlikely(fcntl(fd, F_SETFL, flags) < 0))
532 118 0 if (likely(is_tcp)) {
535 0 118 if (unlikely(setsockopt(fd, SOL_TCP, TCP_NODELAY, &flags, sizeof(int))))
541 0 118 if (unlikely(setsockopt(fd, SOL_SOCKET, SO_OOBINLINE, &flags, sizeof(int))))
546 0 118 if (unlikely(setsockopt(fd, SOL_SOCKET, SO_LINGER, &linger, sizeof(linger))))
555 103 118 if (unlikely(c->fd < 0))
561 0 118 if (unlikely(close(c->fd)))
571 118 0 SvUPGRADE(self, SVt_PVMG); // ensures sv_bless doesn't reallocate
572 118 0 SvGROW(self, sizeof(struct feer_conn));
118 0 SvGROW(self, sizeof(struct feer_conn));
609 0 204 if (unlikely(!sv_isa(rv,"Feersum::Connection")))
625 0 108 if (unlikely(!SvROK(rv))) croak("Expected a reference");
628 108 0 if (likely(
35 73 if (likely(
35 0 if (likely(
108 0 if (likely(
633 0 108 UV uv = SvUV(sv);
634 21 87 if (uv == 0) {
635 4 17 if (can_croak) croak("Operation not allowed: Handle is closed.");
641 0 0 if (can_croak)
652 19 9 sv_bless(sv, is_writer ? feer_conn_writer_stash : feer_conn_reader_stash);
688 7 118 if (unlikely(ev_is_active(&c->read_ev_io)))
697 13 118 if (unlikely(!ev_is_active(&c->read_ev_io)))
706 118 6 if (likely(!ev_is_active(&c->read_ev_timer))) {
716 13 118 if (unlikely(!ev_is_active(&c->read_ev_timer)))
725 46 118 if (unlikely(ev_is_active(&c->write_ev_io)))
734 7 118 if (unlikely(!ev_is_active(&c->write_ev_io)))
745 108 77 while (request_ready_rinq) {
752 97 11 if (likely(c->wbuf_rinq)) {
763 0 28 if (unlikely(revents & EV_ERROR)) {
769 28 0 if (!ev_is_active(&accept_w) && !shutting_down) {
28 0 if (!ev_is_active(&accept_w) && !shutting_down) {
778 0 503 if (unlikely(revents & EV_ERROR)) {
784 77 426 if (request_ready_rinq)
791 0 76 if (unlikely(revents & EV_ERROR)) {
797 0 76 if (request_ready_rinq)
813 0 156 if (unlikely(revents & EV_ERROR && !(revents & EV_WRITE))) {
0 0 if (unlikely(revents & EV_ERROR && !(revents & EV_WRITE))) {
819 42 114 if (unlikely(!c->wbuf_rinq)) {
820 0 42 if (unlikely(c->responding >= RESPOND_SHUTDOWN))
823 0 42 if (!c->poll_write_cb) {
825 0 0 if (c->responding == RESPOND_STREAMING)
833 38 4 if (c->poll_write_cb_is_io_handle)
839 0 42 if (unlikely(!c->wbuf_rinq)) goto try_write_again;
857 0 156 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 1193 156 for (i = m->offset; i < m->count && wrote > 0; i++) {
1193 0 for (i = m->offset; i < m->count && wrote > 0; i++) {
869 0 1193 if (unlikely(v->iov_len > wrote)) {
882 632 561 if (m->sv[i]) {
889 156 0 if (likely(m->offset >= m->count)) {
893 156 0 if (!c->wbuf_rinq)
917 38 15 if (c->poll_write_cb) goto try_write_again;
945 111 0 if (likely(!req)) {
969 0 123 if (unlikely(revents & EV_ERROR && !(revents & EV_READ))) {
0 0 if (unlikely(revents & EV_ERROR && !(revents & EV_READ))) {
974 0 123 if (unlikely(c->receiving == RECEIVE_SHUTDOWN))
979 118 5 if (likely(!c->rbuf)) { // likely = optimize for small requests
986 3 120 if (unlikely(space_free < READ_BUFSZ)) { // unlikely = optimize for small
990 3 0 SvGROW(c->rbuf, new_len);
3 0 SvGROW(c->rbuf, new_len);
997 7 116 if (unlikely(got_n <= 0)) {
998 7 0 if (unlikely(got_n == 0)) {
1002 0 0 if (likely(errno == EAGAIN || errno == EINTR))
0 0 if (likely(errno == EAGAIN || errno == EINTR))
1011 111 5 if (likely(c->receiving == RECEIVE_HEADERS)) {
1038 1 110 if (ret == -1) goto try_read_bad;
1039 1 109 if (ret == -2) goto try_read_again;
1041 4 105 if (process_request_headers(c, ret))
1046 5 0 else if (likely(c->receiving == RECEIVE_BODY)) {
1048 2 3 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 86 if (unlikely(shutting_down)) {
1147 0 86 if (unlikely(revents & EV_ERROR)) {
1161 86 118 if (fd == -1) break;
1165 0 118 if (unlikely(sa_buf.ss_family == AF_UNIX)) is_tcp = 0;
1169 0 118 if (unlikely(prep_socket(fd, is_tcp))) {
1192 77 31 if (!ev_is_active(&ei)) {
1214 98 11 if (likely(str_eq("GET", 3, req->method, req->method_len))) {
1220 0 11 else if (likely(str_eq("OPTIONS", 7, req->method, req->method_len))) {
1224 11 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 109 0 char *from = SvPV(c->rbuf,from_len);
1255 0 109 ? need : READ_INIT_FACTOR*READ_BUFSZ-1;
1257 15 94 SV *new_rbuf = newSVpvn(need ? from : "", need);
1263 98 11 if (likely(next_req_follows)) // optimize for GET
1269 27 0 for (i=0; i < req->num_headers; i++) {
1271 0 27 if (!hdr->name) continue;
1273 11 16 if (unlikely(
1277 11 0 if (likely(g == IS_NUMBER_IN_UV)) {
1278 0 11 if (unlikely(expected > MAX_BODY_LEN)) {
1296 0 0 if (body_is_required) {
1316 11 0 SvGROW(c->rbuf, c->expected_cl + 1);
2 9 SvGROW(c->rbuf, c->expected_cl + 1);
1320 10 1 if (unlikely(c->expected_cl && c->received_cl < c->expected_cl)) {
4 6 if (unlikely(c->expected_cl && c->received_cl < c->expected_cl)) {
1336 202 126 if (c->in_callback) return; // defer until out of callback
1338 103 23 if (c->write_ev_io.data == NULL) {
1357 0 5 if (unlikely(c->responding != RESPOND_NOT_STARTED)) {
1362 5 0 if (!msg_len) msg_len = strlen(msg);
1387 22 109 if (a_len != b_len) return 0;
1388 0 109 if (a == b) return 1;
1390 338 109 for (i=0; i
338 0 for (i=0; i
1391 0 338 if (a[i] != b[i]) return 0;
1402 774 79 if (a_len != b_len) return 0;
1403 0 79 if (a == b) return 1;
1405 566 39 for (i=0; i
566 0 for (i=0; i
1406 40 526 if (a[i] != tolower(b[i])) return 0;
1414 30 2 if (likely('0' <= ch && ch <= '9'))
26 4 if (likely('0' <= ch && ch <= '9'))
1416 4 2 else if ('A' <= ch && ch <= 'F')
2 2 else if ('A' <= ch && ch <= 'F')
1418 2 2 else if ('a' <= ch && ch <= 'f')
2 0 else if ('a' <= ch && ch <= 'f')
1429 99 0 ptr = SvPV(sv, len);
1433 360 92 while (ptr < end) {
1434 7 353 if (unlikely(*ptr == '%')) goto needs_decode;
1445 46 7 for (; ptr < end; ptr++) {
1446 16 30 if (unlikely(*ptr == '%') && likely(end - ptr >= 2)) {
16 0 if (unlikely(*ptr == '%') && likely(end - ptr >= 2)) {
1449 15 1 if (likely(c1 != -1 && c2 != -1)) {
14 1 if (likely(c1 != -1 && c2 != -1)) {
1460 7 0 ptr = SvPV_nolen(sv);
1528 23 76 if (unlikely(!feersum_tmpl_env))
1540 96 3 hv_stores(e, "SERVER_PROTOCOL", (r->minor_version == 1) ?
1548 99 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 99 0 if (likely(str_addr)) {
1579 9 90 if (unlikely(c->expected_cl > 0)) {
1587 73 26 if (request_cb_is_psgi) {
1599 510 16 while (*qpos != '?' && qpos < r->path + r->path_len)
427 83 while (*qpos != '?' && qpos < r->path + r->path_len)
1602 16 83 if (*qpos == '?') {
1613 16 83 if (qstr != NULL) // hv template defaults QUERY_STRING to empty
1623 349 99 for (i=0; inum_headers; i++) {
1625 0 349 if (unlikely(hdr->name == NULL && val != NULL)) {
0 0 if (unlikely(hdr->name == NULL && val != NULL)) {
1630 10 339 else if (unlikely(str_case_eq(
1637 10 329 else if (unlikely(str_case_eq(
1645 0 329 if (kbuflen < klen) {
1650 2687 329 for (j=0; jname_len; j++) {
1652 2480 207 *key++ = (n == '-') ? '_' : toupper(n);
1660 1 328 if (unlikely(SvPOK(*val))) {
1685 0 98 if (unlikely(c->responding != RESPOND_NOT_STARTED))
1687 28 70 change_responding_state(c, streaming ? RESPOND_STREAMING : RESPOND_NORMAL);
1689 0 98 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)))) {
98 0 if (unlikely(!SvOK(message) || !(SvIOK(message) || SvPOK(message)))) {
21 77 if (unlikely(!SvOK(message) || !(SvIOK(message) || SvPOK(message)))) {
0 21 if (unlikely(!SvOK(message) || !(SvIOK(message) || SvPOK(message)))) {
0 98 if (unlikely(!SvOK(message) || !(SvIOK(message) || SvPOK(message)))) {
1694 0 98 if (unlikely(avl+1 % 2 == 1)) {
1700 77 21 if (SvIOK(message))
1701 77 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 98 if (unlikely(!code))
1715 57 41 if (likely(!SvPOK(message) || SvCUR(message) == 3)) {
37 20 if (likely(!SvPOK(message) || SvCUR(message) == 3)) {
1721 95 3 c->auto_cl = (code == 304 || (100 <= code && code <= 199)) ? 0 : 1;
95 0 c->auto_cl = (code == 304 || (100 <= code && code <= 199)) ? 0 : 1;
95 0 c->auto_cl = (code == 304 || (100 <= code && code <= 199)) ? 0 : 1;
1723 94 4 add_const_to_wbuf(c, c->is_http11 ? "HTTP/1.1 " : "HTTP/1.0 ", 9);
1727 139 98 for (i=0; i
1729 139 0 if (unlikely(!hdr || !SvOK(*hdr))) {
0 139 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 139 if (unlikely(!hdr || !SvOK(*hdr))) {
1735 139 0 if (unlikely(!val || !SvOK(*val))) {
0 139 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 139 if (unlikely(!val || !SvOK(*val))) {
1741 139 0 const char *hp = SvPV(*hdr, hlen);
1755 28 70 if (streaming) {
1756 24 4 if (c->is_http11)
1773 0 70 if (c->responding != RESPOND_NORMAL)
1776 0 70 if (!SvOK(body)) {
0 0 if (!SvOK(body)) {
0 0 if (!SvOK(body)) {
1780 67 3 else if (SvROK(body)) {
1782 65 2 if (SvOK(refd) && !SvROK(refd)) {
65 0 if (SvOK(refd) && !SvROK(refd)) {
0 65 if (SvOK(refd) && !SvROK(refd)) {
2 0 if (SvOK(refd) && !SvROK(refd)) {
1786 0 65 else if (SvTYPE(refd) != SVt_PVAV) {
1796 67 3 if (likely(c->auto_cl))
1801 5 65 if (body_is_string) {
1809 91 65 for (i=0; i<=amax; i++) {
1811 1 90 if (unlikely(!sv)) continue;
1818 67 3 if (likely(c->auto_cl)) {
1834 0 17 PUSHMARK(SP);
1835 0 17 mXPUSHs(feer_conn_2sv(c));
1836 0 17 XPUSHs(streamer);
1840 17 0 if (unlikely(SvTRUE(ERRSV))) {
17 0 if (unlikely(SvTRUE(ERRSV))) {
17 0 if (unlikely(SvTRUE(ERRSV))) {
17 0 if (unlikely(SvTRUE(ERRSV))) {
0 17 if (unlikely(SvTRUE(ERRSV))) {
0 0 if (unlikely(SvTRUE(ERRSV))) {
17 0 if (unlikely(SvTRUE(ERRSV))) {
0 17 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))) {
17 0 if (unlikely(SvTRUE(ERRSV))) {
17 0 if (unlikely(SvTRUE(ERRSV))) {
17 0 if (unlikely(SvTRUE(ERRSV))) {
17 0 if (unlikely(SvTRUE(ERRSV))) {
17 0 if (unlikely(SvTRUE(ERRSV))) {
17 0 if (unlikely(SvTRUE(ERRSV))) {
17 0 if (unlikely(SvTRUE(ERRSV))) {
0 17 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 17 if (unlikely(SvTRUE(ERRSV))) {
1844 17 0 FREETMPS;
1852 0 78 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))) {
78 0 if (unlikely(!SvOK(ret) || !SvROK(ret))) {
0 78 if (unlikely(!SvOK(ret) || !SvROK(ret))) {
1853 0 0 sv_setpvs(ERRSV, "Invalid PSGI response (expected reference)");
1858 0 78 if (SvOK(ret) && unlikely(!IsArrayRef(ret))) {
0 0 if (SvOK(ret) && unlikely(!IsArrayRef(ret))) {
0 0 if (SvOK(ret) && unlikely(!IsArrayRef(ret))) {
78 0 if (SvOK(ret) && unlikely(!IsArrayRef(ret))) {
17 61 if (SvOK(ret) && unlikely(!IsArrayRef(ret))) {
1859 17 0 if (likely(can_recurse)) {
1864 0 0 sv_setpvs(ERRSV, "PSGI attempt to recurse in a streaming callback");
1871 0 61 if (unlikely(av_len(psgi_triplet)+1 != 3)) {
1872 0 0 sv_setpvs(ERRSV, "Invalid PSGI array response (expected triplet)");
1884 61 0 if (IsArrayRef(hdrs))
61 0 if (IsArrayRef(hdrs))
1887 0 0 sv_setpvs(ERRSV, "PSGI Headers must be an array-ref");
1892 61 0 if (likely(IsArrayRef(body))) {
48 13 if (likely(IsArrayRef(body))) {
1896 13 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 19 4 if (is_writer) {
1915 0 19 if (c->poll_write_cb) {
1919 15 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 2 PUSHMARK(SP);
1960 0 2 mXPUSHs(newSVsv(ERRSV));
2 0 mXPUSHs(newSVsv(ERRSV));
1966 2 0 sv_setsv(ERRSV, &PL_sv_undef);
1982 0 108 PUSHMARK(SP);
1984 73 35 if (request_cb_is_psgi) {
1986 0 73 mXPUSHs(newRV_noinc((SV*)env));
1990 0 35 mXPUSHs(feer_conn_2sv(c));
2000 108 0 if (unlikely(SvTRUE(ERRSV))) {
108 0 if (unlikely(SvTRUE(ERRSV))) {
108 0 if (unlikely(SvTRUE(ERRSV))) {
108 0 if (unlikely(SvTRUE(ERRSV))) {
0 108 if (unlikely(SvTRUE(ERRSV))) {
0 0 if (unlikely(SvTRUE(ERRSV))) {
108 0 if (unlikely(SvTRUE(ERRSV))) {
0 108 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))) {
108 0 if (unlikely(SvTRUE(ERRSV))) {
108 0 if (unlikely(SvTRUE(ERRSV))) {
108 0 if (unlikely(SvTRUE(ERRSV))) {
108 0 if (unlikely(SvTRUE(ERRSV))) {
108 0 if (unlikely(SvTRUE(ERRSV))) {
106 2 if (unlikely(SvTRUE(ERRSV))) {
106 0 if (unlikely(SvTRUE(ERRSV))) {
0 106 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))) {
2 106 if (unlikely(SvTRUE(ERRSV))) {
2006 73 35 if (request_cb_is_psgi && likely(returned >= 1)) {
72 1 if (request_cb_is_psgi && likely(returned >= 1)) {
2014 73 35 if (request_cb_is_psgi && likely(returned >= 1)) {
72 1 if (request_cb_is_psgi && likely(returned >= 1)) {
2020 73 35 if (request_cb_is_psgi && c->expected_cl > 0) {
3 70 if (request_cb_is_psgi && c->expected_cl > 0) {
2028 108 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 38 if (unlikely(io == NULL)) return;
2090 0 38 PUSHMARK(SP);
2091 0 38 XPUSHs(c->poll_write_cb);
2099 38 0 if (unlikely(SvTRUE(ERRSV))) {
38 0 if (unlikely(SvTRUE(ERRSV))) {
38 0 if (unlikely(SvTRUE(ERRSV))) {
38 0 if (unlikely(SvTRUE(ERRSV))) {
0 38 if (unlikely(SvTRUE(ERRSV))) {
0 0 if (unlikely(SvTRUE(ERRSV))) {
38 0 if (unlikely(SvTRUE(ERRSV))) {
0 38 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))) {
38 0 if (unlikely(SvTRUE(ERRSV))) {
38 0 if (unlikely(SvTRUE(ERRSV))) {
38 0 if (unlikely(SvTRUE(ERRSV))) {
38 0 if (unlikely(SvTRUE(ERRSV))) {
38 0 if (unlikely(SvTRUE(ERRSV))) {
38 0 if (unlikely(SvTRUE(ERRSV))) {
38 0 if (unlikely(SvTRUE(ERRSV))) {
0 38 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 38 if (unlikely(SvTRUE(ERRSV))) {
2105 38 0 if (returned > 0)
2107 38 0 if (ret && SvMAGICAL(ret))
0 38 if (ret && SvMAGICAL(ret))
2110 38 0 if (unlikely(!ret || !SvOK(ret))) {
13 25 if (unlikely(!ret || !SvOK(ret))) {
13 0 if (unlikely(!ret || !SvOK(ret))) {
13 0 if (unlikely(!ret || !SvOK(ret))) {
13 0 if (unlikely(!ret || !SvOK(ret))) {
13 25 if (unlikely(!ret || !SvOK(ret))) {
2112 0 13 PUSHMARK(SP);
2113 0 13 XPUSHs(c->poll_write_cb);
2118 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))) {
2119 0 0 trouble("Couldn't close body IO handle: %-p",ERRSV);
2130 25 0 if (c->is_http11)
2139 38 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 29 if (feer_server_name)
2214 0 29 if (feer_server_port)
2258 0 37 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)))
37 0 if (unlikely(!SvOK(cb) || !SvROK(cb)))
0 37 if (unlikely(!SvOK(cb) || !SvROK(cb)))
2260 8 29 if (request_cb_cv)
2273 10 0 if (!IsCodeRef(cb))
0 10 if (!IsCodeRef(cb))
2275 0 10 if (unlikely(shutting_down))
2284 9 1 if (active_conns <= 0) {
2289 0 9 PUSHMARK(SP);
2295 0 1 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 29 0 if (request_cb_cv)
2349 11 17 if (hdl == NULL) {
2357 6 5 if (ix == 2) // only close the writer on destruction
2373 4 9 if (unlikely(items == 4) && SvOK(ST(3)) && SvIOK(ST(3)))
0 4 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)))
4 0 if (unlikely(items == 4) && SvOK(ST(3)) && SvIOK(ST(3)))
2374 4 0 offset = SvIV(ST(3));
2381 0 13 if (unlikely(c->receiving <= RECEIVE_HEADERS))
2385 6 7 if (!SvOK(buf) || !SvPOK(buf)) {
6 0 if (!SvOK(buf) || !SvPOK(buf)) {
0 6 if (!SvOK(buf) || !SvPOK(buf)) {
0 7 if (!SvOK(buf) || !SvPOK(buf)) {
2388 6 0 SvGROW(buf, len+1);
2 4 SvGROW(buf, len+1);
2391 0 13 if (unlikely(SvREADONLY(buf)))
2394 0 13 if (unlikely(len == 0))
2397 13 0 buf_ptr = SvPV(buf, buf_len);
2398 11 2 if (likely(c->rbuf))
2399 11 0 src_ptr = SvPV(c->rbuf, src_len);
2404 1 12 if (unlikely(offset < 0))
2405 1 0 offset = (-offset >= c->received_cl) ? 0 : c->received_cl + offset;
2407 4 9 if (unlikely(len + offset > src_len))
2413 11 2 if (unlikely(!c->rbuf || src_len == 0 || offset >= c->received_cl)) {
0 11 if (unlikely(!c->rbuf || src_len == 0 || offset >= c->received_cl)) {
11 2 if (unlikely(!c->rbuf || src_len == 0 || offset >= c->received_cl)) {
0 11 if (unlikely(!c->rbuf || src_len == 0 || offset >= c->received_cl)) {
2415 2 0 if (c->receiving == RECEIVE_SHUTDOWN) {
2424 6 5 if (likely(len == src_len && offset == 0)) {
6 0 if (likely(len == src_len && offset == 0)) {
2427 4 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 24 if (unlikely(c->responding != RESPOND_STREAMING))
2458 24 0 SV *body = (items == 2) ? ST(1) : &PL_sv_undef;
2459 24 0 if (unlikely(!body || !SvOK(body)))
0 24 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 24 if (unlikely(!body || !SvOK(body)))
2463 0 24 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 24 0 (void)SvPV(body, RETVAL);
2474 15 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 9 0 if (items == 3 && SvOK(ST(2)) && SvIOK(ST(2)))
0 9 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)))
9 0 if (items == 3 && SvOK(ST(2)) && SvIOK(ST(2)))
2519 9 0 whence = SvIV(ST(2));
2523 1 8 if (unlikely(!c->rbuf)) {
2527 2 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 9 0 if (IsArrayRef(psgi_response)) {
9 0 if (IsArrayRef(psgi_response)) {
2651 6 3 if (len == 3) {
2656 3 0 else if (len == 2) {
2659 3 0 if (unlikely(!IsArrayRef(headers)))
0 3 if (unlikely(!IsArrayRef(headers)))
2698 2 1 RETVAL = feersum_conn_guard(aTHX_ c, (items == 2) ? ST(1) : NULL);
2709 111 7 if (likely(c->rbuf)) SvREFCNT_dec(c->rbuf);
2711 0 118 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 111 7 if (likely(c->req)) {
2722 109 2 if (c->req->buf) SvREFCNT_dec(c->req->buf);
2726 118 0 if (likely(c->sa)) free(c->sa);
2730 0 118 if (c->poll_write_cb) SvREFCNT_dec(c->poll_write_cb);
2732 2 116 if (c->ext_guard) SvREFCNT_dec(c->ext_guard);
2736 3 115 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 32 I_EV_API("Feersum");
32 0 I_EV_API("Feersum");
32 0 I_EV_API("Feersum");
0 32 I_EV_API("Feersum");