• Home
  • Raw
  • Download

Lines Matching refs:rb_

119   rb_.ensure_chunk();  in read_clear()
121 if (rb_.rleft() && on_read() != 0) { in read_clear()
124 if (rb_.rleft() == 0) { in read_clear()
125 rb_.reset(); in read_clear()
126 } else if (rb_.wleft() == 0) { in read_clear()
135 auto nread = conn_.read_clear(rb_.last(), rb_.wleft()); in read_clear()
138 if (rb_.rleft() == 0) { in read_clear()
139 rb_.release_chunk(); in read_clear()
148 rb_.write(nread); in read_clear()
185 rb_.ensure_chunk(); in proxy_protocol_peek_clear()
187 assert(rb_.rleft() == 0); in proxy_protocol_peek_clear()
189 auto nread = conn_.peek_clear(rb_.last(), rb_.wleft()); in proxy_protocol_peek_clear()
202 rb_.write(nread); in proxy_protocol_peek_clear()
208 rb_.reset(); in proxy_protocol_peek_clear()
247 rb_.ensure_chunk(); in read_tls()
251 if (rb_.rleft() && on_read() != 0) { in read_tls()
254 if (rb_.rleft() == 0) { in read_tls()
255 rb_.reset(); in read_tls()
256 } else if (rb_.wleft() == 0) { in read_tls()
265 auto nread = conn_.read_tls(rb_.last(), rb_.wleft()); in read_tls()
268 if (rb_.rleft() == 0) { in read_tls()
269 rb_.release_chunk(); in read_tls()
278 rb_.write(nread); in read_tls()
359 auto nread = std::min(left_connhd_len_, rb_.rleft()); in upstream_http2_connhd_read()
361 rb_.pos(), nread) != 0) { in upstream_http2_connhd_read()
371 rb_.drain(nread); in upstream_http2_connhd_read()
388 auto nread = std::min(left_connhd_len_, rb_.rleft()); in upstream_http1_connhd_read()
390 rb_.pos(), nread) != 0) { in upstream_http1_connhd_read()
409 rb_.drain(nread); in upstream_http1_connhd_read()
444 rb_(worker->get_mcpool()), in ClientHandler()
694 if (rb_.chunk_avail()) { in on_read()
1246 ClientHandler::ReadBuf *ClientHandler::get_rb() { return &rb_; } in get_rb()
1287 auto len = rb_.pos() - rb_.begin(); in on_proxy_protocol_finish()
1296 rb_.reset(); in on_proxy_protocol_finish()
1298 if (conn_.read_nolim_clear(rb_.pos(), len) < 0) { in on_proxy_protocol_finish()
1302 rb_.reset(); in on_proxy_protocol_finish()
1325 auto first = rb_.pos(); in proxy_protocol_read()
1327 if (rb_.rleft() >= PROXY_PROTO_V2_HDLEN && in proxy_protocol_read()
1342 auto bufend = rb_.pos() + std::min(MAX_PROXY_LINELEN, rb_.rleft()); in proxy_protocol_read()
1345 std::find_first_of(rb_.pos(), bufend, std::begin(chrs), std::end(chrs)); in proxy_protocol_read()
1347 if (end == bufend || *end == '\0' || end == rb_.pos() || *(end - 1) != '\r') { in proxy_protocol_read()
1358 if (static_cast<size_t>(end - rb_.pos()) < HEADER.size()) { in proxy_protocol_read()
1365 if (!util::streq(HEADER, StringRef{rb_.pos(), HEADER.size()})) { in proxy_protocol_read()
1372 rb_.drain(HEADER.size()); in proxy_protocol_read()
1376 if (rb_.pos()[0] == 'T') { in proxy_protocol_read()
1377 if (end - rb_.pos() < 5) { in proxy_protocol_read()
1384 if (rb_.pos()[1] != 'C' || rb_.pos()[2] != 'P') { in proxy_protocol_read()
1391 switch (rb_.pos()[3]) { in proxy_protocol_read()
1405 rb_.drain(5); in proxy_protocol_read()
1407 if (end - rb_.pos() < 7) { in proxy_protocol_read()
1413 if (!util::streq_l("UNKNOWN", rb_.pos(), 7)) { in proxy_protocol_read()
1420 rb_.drain(end + 2 - rb_.pos()); in proxy_protocol_read()
1426 auto token_end = std::find(rb_.pos(), end, ' '); in proxy_protocol_read()
1435 if (!util::numeric_host(reinterpret_cast<const char *>(rb_.pos()), family)) { in proxy_protocol_read()
1442 auto src_addr = rb_.pos(); in proxy_protocol_read()
1443 auto src_addrlen = token_end - rb_.pos(); in proxy_protocol_read()
1445 rb_.drain(token_end - rb_.pos() + 1); in proxy_protocol_read()
1448 token_end = std::find(rb_.pos(), end, ' '); in proxy_protocol_read()
1457 if (!util::numeric_host(reinterpret_cast<const char *>(rb_.pos()), family)) { in proxy_protocol_read()
1466 rb_.drain(token_end - rb_.pos() + 1); in proxy_protocol_read()
1469 auto n = parse_proxy_line_port(rb_.pos(), end); in proxy_protocol_read()
1470 if (n <= 0 || *(rb_.pos() + n) != ' ') { in proxy_protocol_read()
1477 rb_.pos()[n] = '\0'; in proxy_protocol_read()
1478 auto src_port = rb_.pos(); in proxy_protocol_read()
1481 rb_.drain(n + 1); in proxy_protocol_read()
1484 n = parse_proxy_line_port(rb_.pos(), end); in proxy_protocol_read()
1485 if (n <= 0 || rb_.pos() + n != end) { in proxy_protocol_read()
1494 rb_.drain(end + 2 - rb_.pos()); in proxy_protocol_read()
1501 CLOG(INFO, this) << "PROXY-protocol-v1: Finished, " << (rb_.pos() - first) in proxy_protocol_read()
1519 assert(rb_.rleft() >= PROXY_PROTO_V2_HDLEN); in proxy_protocol_v2_read()
1521 auto p = rb_.pos() + str_size(PROXY_PROTO_V2_SIG); in proxy_protocol_v2_read()
1555 if (rb_.last() - p < len) { in proxy_protocol_v2_read()
1559 << len << " bytes, " << rb_.last() - p << " bytes left"; in proxy_protocol_v2_read()
1608 rb_.drain(PROXY_PROTO_V2_HDLEN + len); in proxy_protocol_v2_read()
1624 rb_.drain(PROXY_PROTO_V2_HDLEN + len); in proxy_protocol_v2_read()
1660 << p - rb_.pos() << " bytes read, " in proxy_protocol_v2_read()
1661 << PROXY_PROTO_V2_HDLEN + len - (p - rb_.pos()) in proxy_protocol_v2_read()
1673 rb_.drain(PROXY_PROTO_V2_HDLEN + len); in proxy_protocol_v2_read()