MCPcopy Create free account
hub / github.com/apache/trafficserver / print

Method print

src/records/RecHttp.cc:580–746  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

578}
579
580int
581HttpProxyPort::print(char *out, size_t n)
582{
583 size_t zret = 0; // # of chars printed so far.
584 ip_text_buffer ipb;
585 bool need_colon_p = false;
586
587 if (m_inbound_ip.isValid()) {
588 zret += snprintf(out + zret, n - zret, "%s=[%s]", OPT_INBOUND_IP_PREFIX, m_inbound_ip.toString(ipb, sizeof(ipb)));
589 need_colon_p = true;
590 }
591 if (zret >= n) {
592 return n;
593 }
594
595 if (m_outbound.has_ip4()) {
596 if (need_colon_p) {
597 out[zret++] = ':';
598 }
599 zret += snprintf(out + zret, n - zret, "%s=[%s]", OPT_OUTBOUND_IP_PREFIX,
600 swoc::FixedBufferWriter(ipb, sizeof(ipb)).print("{}", m_outbound.ip4()).data());
601 need_colon_p = true;
602 }
603 if (zret >= n) {
604 return n;
605 }
606
607 if (m_outbound.has_ip6()) {
608 if (need_colon_p) {
609 out[zret++] = ':';
610 }
611 zret += snprintf(out + zret, n - zret, "%s=[%s]", OPT_OUTBOUND_IP_PREFIX,
612 swoc::FixedBufferWriter(ipb, sizeof(ipb)).print("{}", m_outbound.ip6()).data());
613 need_colon_p = true;
614 }
615 if (zret >= n) {
616 return n;
617 }
618
619 if (0 != m_port) {
620 if (need_colon_p) {
621 out[zret++] = ':';
622 }
623 zret += snprintf(out + zret, n - zret, "%d", m_port);
624 need_colon_p = true;
625 }
626 if (zret >= n) {
627 return n;
628 }
629
630 if (ts::NO_FD != m_fd) {
631 if (need_colon_p) {
632 out[zret++] = ':';
633 }
634 zret += snprintf(out + zret, n - zret, "fd=%d", m_fd);
635 }
636 if (zret >= n) {
637 return n;

Callers 2

mainFunction · 0.45
test_RecHttp.ccFile · 0.45

Calls 15

isSSLMethod · 0.95
isQUICMethod · 0.95
has_ip4Method · 0.80
has_ip6Method · 0.80
markOutMethod · 0.80
nameForMethod · 0.80
FixedBufferWriterClass · 0.50
isValidMethod · 0.45
toStringMethod · 0.45
dataMethod · 0.45
ip4Method · 0.45

Tested by 1

mainFunction · 0.36