Add comments

This commit is contained in:
Alfredo Cardigliano 2025-09-10 15:45:56 +02:00
parent 7e9063dde8
commit bc610bb3ee
2 changed files with 9 additions and 2 deletions

View file

@ -4872,13 +4872,20 @@ void Flow::housekeep(time_t t) {
/* *************************************** */
/**
* Returns partial traffic stats by computing a delta between current flow stats ("stats")
* and the previous snapshot ("dst").
* Note:
* - Delta is returned in "fts"
* - "dst" is updated taking the "stats" value
*/
bool Flow::get_partial_traffic_stats(PartializableFlowTrafficStats **dst,
PartializableFlowTrafficStats *fts,
bool *first_partial) const {
if(!fts || !dst) return (false);
if(!*dst) {
if(!(*dst = new (std::nothrow) PartializableFlowTrafficStats()))
if((*dst = new (std::nothrow) PartializableFlowTrafficStats()) == NULL)
return (false);
*first_partial = true;
} else {

View file

@ -287,7 +287,7 @@ void PartializableFlowTrafficStats::incDNSResp(u_int16_t resp_code) {
void PartializableFlowTrafficStats::get_partial(PartializableFlowTrafficStats *dst,
PartializableFlowTrafficStats *fts) const {
/* Set temp to the current value */
/* Set tmp to the current value */
PartializableFlowTrafficStats tmp(*this);
/* Compute the differences between the snapshot tmp and the values found in