mirror of
https://github.com/zeek/zeek.git
synced 2025-10-09 18:18:19 +00:00
Changing the HTTP's analyzers internals to use 64-bit integers.
(Gregor Maier). This is the patch from #326, plus some cleanup.
This commit is contained in:
parent
80376653c2
commit
714289bd13
13 changed files with 56 additions and 62 deletions
|
@ -120,7 +120,7 @@ void ContentLine_Analyzer::EndpointEOF(bool is_orig)
|
|||
DeliverStream(1, (const u_char*) "\n", is_orig);
|
||||
}
|
||||
|
||||
void ContentLine_Analyzer::SetPlainDelivery(int length)
|
||||
void ContentLine_Analyzer::SetPlainDelivery(int64_t length)
|
||||
{
|
||||
if ( length < 0 )
|
||||
internal_error("negative length for plain delivery");
|
||||
|
@ -154,7 +154,7 @@ void ContentLine_Analyzer::DoDeliver(int len, const u_char* data)
|
|||
|
||||
if ( plain_delivery_length > 0 )
|
||||
{
|
||||
int deliver_plain = min(plain_delivery_length, len);
|
||||
int deliver_plain = min(plain_delivery_length, (int64_t)len);
|
||||
|
||||
last_char = 0; // clear last_char
|
||||
plain_delivery_length -= deliver_plain;
|
||||
|
@ -179,7 +179,7 @@ void ContentLine_Analyzer::DoDeliver(int len, const u_char* data)
|
|||
if ( seq < seq_to_skip )
|
||||
{
|
||||
// Skip rest of the data and return
|
||||
int skip_len = seq_to_skip - seq;
|
||||
int64_t skip_len = seq_to_skip - seq;
|
||||
if ( skip_len > len )
|
||||
skip_len = len;
|
||||
|
||||
|
@ -310,7 +310,7 @@ void ContentLine_Analyzer::CheckNUL()
|
|||
}
|
||||
}
|
||||
|
||||
void ContentLine_Analyzer::SkipBytesAfterThisLine(int length)
|
||||
void ContentLine_Analyzer::SkipBytesAfterThisLine(int64_t length)
|
||||
{
|
||||
// This is a little complicated because Bro has to handle
|
||||
// both CR and CRLF as a line break. When a line is delivered,
|
||||
|
@ -326,7 +326,7 @@ void ContentLine_Analyzer::SkipBytesAfterThisLine(int length)
|
|||
SkipBytes(length);
|
||||
}
|
||||
|
||||
void ContentLine_Analyzer::SkipBytes(int length)
|
||||
void ContentLine_Analyzer::SkipBytes(int64_t length)
|
||||
{
|
||||
skip_pending = 0;
|
||||
seq_to_skip = SeqDelivered() + length;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue