mirror of
https://github.com/zeek/zeek.git
synced 2025-10-12 11:38:20 +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
|
@ -44,16 +44,16 @@ public:
|
|||
// mode for next <length> bytes. Plain-delivery data is also passed
|
||||
// via DeliverStream() and can differentiated by calling
|
||||
// IsPlainDelivery().
|
||||
void SetPlainDelivery(int length);
|
||||
int GetPlainDeliveryLength() const { return plain_delivery_length; }
|
||||
void SetPlainDelivery(int64_t length);
|
||||
int64_t GetPlainDeliveryLength() const { return plain_delivery_length; }
|
||||
bool IsPlainDelivery() { return is_plain; }
|
||||
|
||||
// Skip <length> bytes after this line.
|
||||
// Can be used to skip HTTP data for performance considerations.
|
||||
void SkipBytesAfterThisLine(int length);
|
||||
void SkipBytes(int length);
|
||||
void SkipBytesAfterThisLine(int64_t length);
|
||||
void SkipBytes(int64_t length);
|
||||
|
||||
bool IsSkippedContents(int seq, int length)
|
||||
bool IsSkippedContents(int64_t seq, int64_t length)
|
||||
{ return seq + length <= seq_to_skip; }
|
||||
|
||||
protected:
|
||||
|
@ -71,26 +71,26 @@ protected:
|
|||
void CheckNUL();
|
||||
|
||||
// Returns the sequence number delivered so far.
|
||||
int SeqDelivered() const { return seq_delivered_in_lines; }
|
||||
int64_t SeqDelivered() const { return seq_delivered_in_lines; }
|
||||
|
||||
u_char* buf; // where we build up the body of the request
|
||||
int offset; // where we are in buf
|
||||
int buf_len; // how big buf is, total
|
||||
unsigned int last_char; // last (non-option) character scanned
|
||||
|
||||
int seq; // last seq number
|
||||
int seq_to_skip;
|
||||
int64_t seq; // last seq number
|
||||
int64_t seq_to_skip;
|
||||
|
||||
// Seq delivered up to through NewLine() -- it is adjusted
|
||||
// *before* NewLine() is called.
|
||||
int seq_delivered_in_lines;
|
||||
int64_t seq_delivered_in_lines;
|
||||
|
||||
// Number of bytes to be skipped after this line. See
|
||||
// comments in SkipBytesAfterThisLine().
|
||||
int skip_pending;
|
||||
int64_t skip_pending;
|
||||
|
||||
// Remaining bytes to deliver plain.
|
||||
int plain_delivery_length;
|
||||
int64_t plain_delivery_length;
|
||||
int is_plain;
|
||||
|
||||
// Don't deliver further data.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue