uint8_t *chunk_buffer[2] = { nullptr, nullptr };
int32_t chunk_buffer_length[2] = { 0, 0 };
bool chunk_buffer_owned[2] = { true, true }; // never actually false and not checked, just here to simplify code
+ bool zero_chunk[2] = { false, false };
// StreamSplitter => Inspector (facts about the most recent message section)
// 0 element refers to client request, 1 element refers to server response
NHttpEnums::SectionType section_type[2] = { NHttpEnums::SEC__NOTCOMPUTE, NHttpEnums::SEC__NOTCOMPUTE };
uint32_t num_excess[2] = { 0, 0 };
- bool zero_chunk[2] = { false, false };
bool tcp_close[2] = { false, false };
uint64_t infractions[2] = { 0, 0 };
uint32_t unused_octets_visible[2] = { 0, 0 };
// Inspector => StreamSplitter (facts about the message section that is coming next)
NHttpEnums::SectionType type_expected[2] = { NHttpEnums::SEC_REQUEST, NHttpEnums::SEC_STATUS };
- int64_t data_length[2] = { NHttpEnums::STAT_NOTPRESENT, NHttpEnums::STAT_NOTPRESENT }; // length of the data from Content-Length field
+ int64_t data_length[2] = { NHttpEnums::STAT_NOTPRESENT, NHttpEnums::STAT_NOTPRESENT }; // length of the data from Content-Length field
// Inspector's internal data about the current message
NHttpEnums::VersionId version_id[2] = { NHttpEnums::VERS__NOTPRESENT, NHttpEnums::VERS__NOTPRESENT };
flush_octets, length, splitter->get_num_excess(), splitter->get_zero_chunk());
if ((type == SEC_REQUEST) || (type == SEC_STATUS)) {
// Look ahead to see if entire header section is already here so we can aggregate it for detection.
- if (session_data->header_splitter[source_id].peek(data + flush_octets, length - flush_octets) == SCAN_FOUND) {
+ if (session_data->header_splitter[source_id].peek(data + flush_octets, length - flush_octets) == SCAN_FOUND) {
session_data->header_octets_visible[source_id] = session_data->header_splitter[source_id].get_num_flush();
}
}
// small chunks are aggregated before processing and are kept here until the buffer is full (paf_max)
// all the chunks in the buffer go to the inspector together. Zero-length chunk (len == 1,
// zero_chunk == true) flushes accumulated chunks.
+ // FIXIT-M this implementation of the zero-length chunk is temporary until stream can support a zero-
+ // octet flush.
const int32_t total_chunk_len = chunk_buffer_length + offset + len - session_data->zero_chunk[source_id];
if ((total_chunk_len < DATABLOCKSIZE) && (!session_data->zero_chunk[source_id]) && !tcp_close) {
chunk_buffer_length = total_chunk_len;