| 496 | -------------------------------------------------------------------------*/ |
| 497 | |
| 498 | void |
| 499 | URLImpl::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 | -------------------------------------------------------------------------*/ |
no test coverage detected