| 391 | } |
| 392 | |
| 393 | inline bool |
| 394 | Http2Stream::payload_length_is_valid() const |
| 395 | { |
| 396 | uint32_t content_length = _receive_header.get_content_length(); |
| 397 | uint64_t mask = (MIME_PRESENCE_IF_UNMODIFIED_SINCE | MIME_PRESENCE_IF_MODIFIED_SINCE | MIME_PRESENCE_IF_RANGE | |
| 398 | MIME_PRESENCE_IF_MATCH | MIME_PRESENCE_IF_NONE_MATCH); |
| 399 | |
| 400 | // Skip Content-Length check on [RFC 7230] 3.3.2 conditions |
| 401 | bool is_payload_precluded = |
| 402 | this->is_outbound_connection() && (_send_header.method_get_wksidx() == HTTP_WKSIDX_HEAD || |
| 403 | (_send_header.method_get_wksidx() == HTTP_WKSIDX_GET && _send_header.presence(mask) && |
| 404 | _receive_header.status_get() == HTTP_STATUS_NOT_MODIFIED)); |
| 405 | |
| 406 | if (content_length != 0 && !is_payload_precluded && content_length != data_length) { |
| 407 | Warning("Bad payload length content_length=%d data_legnth=%d session_id=%" PRId64, content_length, |
| 408 | static_cast<int>(data_length), _proxy_ssn->connection_id()); |
| 409 | return false; |
| 410 | } |
| 411 | return true; |
| 412 | } |
| 413 | |
| 414 | inline bool |
| 415 | Http2Stream::is_state_writeable() const |
no test coverage detected