diff --git a/src/analyzer/protocol/http/HTTP.cc b/src/analyzer/protocol/http/HTTP.cc index 5bb608022a..e82c044cc8 100644 --- a/src/analyzer/protocol/http/HTTP.cc +++ b/src/analyzer/protocol/http/HTTP.cc @@ -511,9 +511,6 @@ void HTTP_Entity::SubmitAllHeaders() // in_header should be set to false when SubmitAllHeaders() is called. ASSERT(! in_header); - if (content_length >= 0 ) - http_message->SetDeliverySize(content_length); - if ( DEBUG_http ) DEBUG_MSG("%.6f end of headers\n", run_state::network_time); @@ -531,6 +528,9 @@ void HTTP_Entity::SubmitAllHeaders() http_message->content_line->SetCRLFAsEOL(0); } + if (content_length >= 0 ) + http_message->SetDeliverySize(content_length); + // The presence of a message-body in a request is signaled by // the inclusion of a Content-Length or Transfer-Encoding // header field in the request's message-headers. diff --git a/src/analyzer/protocol/tcp/ContentLine.cc b/src/analyzer/protocol/tcp/ContentLine.cc index 749aa23d2c..0defbba1b0 100644 --- a/src/analyzer/protocol/tcp/ContentLine.cc +++ b/src/analyzer/protocol/tcp/ContentLine.cc @@ -99,10 +99,14 @@ void ContentLine_Analyzer::DeliverStream(int len, const u_char* data, // If we have parsed all the data of the packet but there is no CRLF at the end // Force the process by flushing buffer - if ( delivery_length == 0 && HasPartialLine() ) + if ( delivery_length == 0 ) { - Weird("No CRLF at the end of the packet"); - DoDeliver(2, (const u_char*) "\r\n"); + if (HasPartialLine()) + { + Weird("line_terminated_without_CRLF"); + DoDeliver(2, (const u_char*) "\r\n"); + } + delivery_length = -1; } seq += len;