[asterisk-dev] [Code Review] app_queue: Support persisting and loading of long member lists

Sean Bright reviewboard at asterisk.org
Sun Sep 30 09:42:33 CDT 2012


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/2136/
-----------------------------------------------------------

(Updated Sept. 30, 2012, 9:42 a.m.)


Review request for Asterisk Developers.


Changes
-------

Added a unit test that stores and retrieves database values from 1K up through 8M.


Summary
-------

Greenlight in #asterisk brought up that he was receiving an error message "Could not create persistent member string, out of space" when running app_queue in Asterisk 10.  dump_queue_members() made an assumption that 8K would be enough to store the generated string, but with queues that have large member lists this is not always the case.  This patch removes the limitation and uses ast_str instead of a fixed sized buffer.

The complicating factor comes from the fact that ast_db_get requires a buffer and buffer size argument, which doesn't let us pull back more than what we pass in, so I introduced a new ast_db_get_allocated() which returns an ast_strdup()'d copy of the value from astdb.

As an aside, I did some testing on the maximum size of data that we can store in the BDB library we distribute and was able to store a 10MB string and retrieve it with no problems, so I feel this is a safe patch.

A similar patch will go into 10, 11, and trunk.


Diffs (updated)
-----

  /branches/1.8/include/asterisk/astdb.h 374095 
  /branches/1.8/main/db.c 374095 
  /branches/1.8/tests/test_db.c 374095 
  /branches/1.8/apps/app_queue.c 374095 

Diff: https://reviewboard.asterisk.org/r/2136/diff


Testing
-------

Compiles and basic functional testing.


Thanks,

Sean

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20120930/cf8ecfdd/attachment.htm>


More information about the asterisk-dev mailing list