[OpenSIPS-Devel] [OpenSIPS/opensips] 9608d8: acc: Fix drop_accounting() regression (211a63c9b2)

Liviu Chircu noreply at github.com
Mon Dec 4 15:03:22 UTC 2023


  Branch: refs/heads/3.4
  Home:   https://github.com/OpenSIPS/opensips
  Commit: 9608d8a1d567fbf7ee1f332cc0dc2805509fa386
      https://github.com/OpenSIPS/opensips/commit/9608d8a1d567fbf7ee1f332cc0dc2805509fa386
  Author: Liviu Chircu <liviu at opensips.org>
  Date:   2023-12-04 (Mon, 04 Dec 2023)

  Changed paths:
    M modules/acc/acc_logic.c
    M modules/acc/acc_logic.h
    A modules/acc/test/opensips.cfg
    A modules/acc/test/test.c

  Log Message:
  -----------
  acc: Fix drop_accounting() regression (211a63c9b2)

Commit 211a63c9 changed drop_accounting() from doing too little
dropping (the "backend bit" would never get reset) into doing too much
dropping (the "backend bit" would always be reset, despite some of the
flags still remaining enabled after the drop operation).

This commit fixes the code and also adds some unit tests for the
set/reset bitmask operations, to lock in the correct behavior.

(cherry picked from commit 0f0de89f6a050255050e913bd3295c2ae2a43fdc)


  Commit: 0bc0e07d60528841aed860e67ee93b84c03e3c60
      https://github.com/OpenSIPS/opensips/commit/0bc0e07d60528841aed860e67ee93b84c03e3c60
  Author: Liviu Chircu <liviu at opensips.org>
  Date:   2023-12-04 (Mon, 04 Dec 2023)

  Changed paths:
    M modules/acc/acc_logic.h
    M modules/acc/test/test.c

  Log Message:
  -----------
  acc: Code improvements

* make the is_xxx_on() macros more practical, by returning `int` instead
of `unsigned long long`, to avoid integer overflows during result check

* add more unit tests

(cherry picked from commit f635a63a7acfc5b55c8f06bd14693d3e710a633b)


Compare: https://github.com/OpenSIPS/opensips/compare/e48fe86ebdbc...0bc0e07d6052



More information about the Devel mailing list