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

Sean Bright reviewboard at asterisk.org
Mon Oct 1 09:23:58 CDT 2012


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

(Updated Oct. 1, 2012, 9:23 a.m.)


Review request for Asterisk Developers.


Summary (updated)
-------

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.

This already has a "Ship It" but I would like a secondary review since I updated the diff.  I'm not sure that the ast_assert that I added in ast_db_get is a safe change.


Diffs
-----

  /branches/1.8/tests/test_db.c 374095 
  /branches/1.8/main/db.c 374095 
  /branches/1.8/include/asterisk/astdb.h 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/20121001/67a767f3/attachment.htm>


More information about the asterisk-dev mailing list