mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 14:48:21 +00:00
The Great Embooleanating
A large number of functions had return values and/or arguments changed to use ``bool`` types instead of ``int``.
This commit is contained in:
parent
3c470ffe13
commit
fd5e15b116
145 changed files with 1288 additions and 1331 deletions
|
@ -453,8 +453,8 @@ void TCP_Reassembler::Overlap(const u_char* b1, const u_char* b2, uint64_t n)
|
|||
// we've ever seen for the connection.
|
||||
(n > 1 || endp->peer->HasDoneSomething()) )
|
||||
{
|
||||
BroString* b1_s = new BroString((const u_char*) b1, n, 0);
|
||||
BroString* b2_s = new BroString((const u_char*) b2, n, 0);
|
||||
BroString* b1_s = new BroString((const u_char*) b1, n, false);
|
||||
BroString* b2_s = new BroString((const u_char*) b2, n, false);
|
||||
|
||||
tcp_analyzer->EnqueueConnEvent(rexmit_inconsistency,
|
||||
IntrusivePtr{AdoptRef{}, tcp_analyzer->BuildConnVal()},
|
||||
|
@ -473,7 +473,7 @@ void TCP_Reassembler::Deliver(uint64_t seq, int len, const u_char* data)
|
|||
dst_analyzer->ForwardStream(len, data, IsOrig());
|
||||
}
|
||||
|
||||
int TCP_Reassembler::DataSent(double t, uint64_t seq, int len,
|
||||
bool TCP_Reassembler::DataSent(double t, uint64_t seq, int len,
|
||||
const u_char* data, TCP_Flags arg_flags, bool replaying)
|
||||
{
|
||||
uint64_t ack = endp->ToRelativeSeqSpace(endp->AckSeq(), endp->AckWraps());
|
||||
|
@ -486,13 +486,13 @@ int TCP_Reassembler::DataSent(double t, uint64_t seq, int len,
|
|||
}
|
||||
|
||||
if ( skip_deliveries )
|
||||
return 0;
|
||||
return false;
|
||||
|
||||
if ( seq < ack && ! replaying )
|
||||
{
|
||||
if ( upper_seq <= ack )
|
||||
// We've already delivered this and it's been acked.
|
||||
return 0;
|
||||
return false;
|
||||
|
||||
// We've seen an ack for part of this packet, but not the
|
||||
// whole thing. This can happen when, for example, a previous
|
||||
|
@ -525,7 +525,7 @@ int TCP_Reassembler::DataSent(double t, uint64_t seq, int len,
|
|||
skip_deliveries = true;
|
||||
}
|
||||
|
||||
return 1;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
@ -647,19 +647,19 @@ void TCP_Reassembler::SkipToSeq(uint64_t seq)
|
|||
}
|
||||
}
|
||||
|
||||
int TCP_Reassembler::DataPending() const
|
||||
bool TCP_Reassembler::DataPending() const
|
||||
{
|
||||
// If we are skipping deliveries, the reassembler will not get called
|
||||
// in DataSent(), and DataSeq() will not be updated.
|
||||
if ( skip_deliveries )
|
||||
return 0;
|
||||
return false;
|
||||
|
||||
uint64_t delivered_seq = Endpoint()->StartSeqI64() + DataSeq();
|
||||
uint64_t last_seq = TCP_Endpoint::ToFullSeqSpace(Endpoint()->LastSeq(),
|
||||
Endpoint()->SeqWraps());
|
||||
|
||||
if ( last_seq < delivered_seq )
|
||||
return 0;
|
||||
return false;
|
||||
|
||||
// Q. Can we say that?
|
||||
// ASSERT(delivered_seq <= last_seq);
|
||||
|
@ -676,12 +676,12 @@ int TCP_Reassembler::DataPending() const
|
|||
// sequence space), or right at it (because a RST does not).
|
||||
if ( delivered_seq != last_seq - 1 &&
|
||||
delivered_seq != last_seq )
|
||||
return 1;
|
||||
return true;
|
||||
|
||||
// If we've sent RST, then we can't send ACKs any more.
|
||||
if ( Endpoint()->state != TCP_ENDPOINT_RESET &&
|
||||
Endpoint()->peer->HasUndeliveredData() )
|
||||
return 1;
|
||||
return true;
|
||||
|
||||
return 0;
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue