[sr-dev] git:5.1:39299866: core: pv - use active values for pv buffer slots and size

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[sr-dev] git:5.1:39299866: core: pv - use active values for pv buffer slots and size

Daniel-Constantin Mierla
Module: kamailio
Branch: 5.1
Commit: 3929986622b502660b870916bcd7f015282a6a1c
URL: https://github.com/kamailio/kamailio/commit/3929986622b502660b870916bcd7f015282a6a1c

Author: Daniel-Constantin Mierla <[hidden email]>
Committer: Daniel-Constantin Mierla <[hidden email]>
Date: 2017-12-04T09:27:09+01:00

core: pv - use active values for pv buffer slots and size

- during startup, param value and active can be different, up to the
moment when the config is completely loaded

(cherry picked from commit a156c625b434dc0bc19c43ece524f90b1179d881)

---

Modified: src/core/pvapi.c

---

Diff:  https://github.com/kamailio/kamailio/commit/3929986622b502660b870916bcd7f015282a6a1c.diff
Patch: https://github.com/kamailio/kamailio/commit/3929986622b502660b870916bcd7f015282a6a1c.patch

---

diff --git a/src/core/pvapi.c b/src/core/pvapi.c
index 0e4d4d326f..64b9fd96ff 100644
--- a/src/core/pvapi.c
+++ b/src/core/pvapi.c
@@ -2105,7 +2105,8 @@ char* pv_get_buffer(void)
  char *p;
 
  p = _pv_print_buffer[_pv_print_buffer_index];
- _pv_print_buffer_index = (_pv_print_buffer_index+1)%_pv_print_buffer_slots;
+ _pv_print_buffer_index = (_pv_print_buffer_index+1)
+ % _pv_print_buffer_slots_active;
 
  return p;
 }
@@ -2115,7 +2116,7 @@ char* pv_get_buffer(void)
  */
 int pv_get_buffer_size(void)
 {
- return _pv_print_buffer_size;
+ return _pv_print_buffer_size_active;
 }
 
 /**
@@ -2123,7 +2124,7 @@ int pv_get_buffer_size(void)
  */
 int pv_get_buffer_slots(void)
 {
- return _pv_print_buffer_slots;
+ return _pv_print_buffer_slots_active;
 }
 
 /**


_______________________________________________
Kamailio (SER) - Development Mailing List
[hidden email]
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev