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

Method set_port

src/proxy/hdrs/URL.cc:498–514  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

496 -------------------------------------------------------------------------*/
497
498void
499URLImpl::set_port(HdrHeap *heap, const char *value, int length, bool copy_string)
500{
501 url_called_set(this);
502 if (length == 0) {
503 value = nullptr;
504 }
505 mime_str_u16_set(heap, value, length, &(this->m_ptr_port), &(this->m_len_port), copy_string);
506
507 this->m_port = 0;
508 for (int i = 0; i < length; i++) {
509 if (!ParseRules::is_digit(value[i])) {
510 break;
511 }
512 this->m_port = this->m_port * 10 + (value[i] - '0');
513 }
514}
515
516/*-------------------------------------------------------------------------
517 -------------------------------------------------------------------------*/

Callers 3

url_parse_internetFunction · 0.80
url_parse_http_regexFunction · 0.80
port_setMethod · 0.80

Calls 4

url_called_setFunction · 0.85
mime_str_u16_setFunction · 0.85
is_digitFunction · 0.85
ink_fast_itoaFunction · 0.85

Tested by

no test coverage detected