| 1594 | } |
| 1595 | |
| 1596 | size_t H2UnsentRequest::EstimatedByteSize() { |
| 1597 | size_t sz = 0; |
| 1598 | for (size_t i = 0; i < _size; ++i) { |
| 1599 | sz += _list[i].name.size() + _list[i].value.size() + 1; |
| 1600 | } |
| 1601 | std::unique_lock<butil::Mutex> mu(_mutex); |
| 1602 | if (_cntl == NULL) { |
| 1603 | return 0; |
| 1604 | } |
| 1605 | if (_cntl->has_http_request()) { |
| 1606 | const HttpHeader& h = _cntl->http_request(); |
| 1607 | for (HttpHeader::HeaderIterator it = h.HeaderBegin(); |
| 1608 | it != h.HeaderEnd(); ++it) { |
| 1609 | sz += it->first.size() + it->second.size() + 1; |
| 1610 | } |
| 1611 | } |
| 1612 | sz += _cntl->request_attachment().size(); |
| 1613 | return sz; |
| 1614 | } |
| 1615 | |
| 1616 | void H2UnsentRequest::Print(std::ostream& os) const { |
| 1617 | os << "[ H2 REQUEST @" << butil::my_ip() << " ]\n"; |
no test coverage detected