<html>
 <body>
  <div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
   <table bgcolor="#f9f3c9" width="100%" cellpadding="8" style="border: 1px #c9c399 solid;">
    <tr>
     <td>
      This is an automatically generated e-mail. To reply, visit:
      <a href="https://reviewboard.asterisk.org/r/2136/">https://reviewboard.asterisk.org/r/2136/</a>
     </td>
    </tr>
   </table>
   <br />








<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
 <p style="margin-top: 0;">On October 1st, 2012, 11:26 a.m., <b>Mark Michelson</b> wrote:</p>
 <blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
  



<table width="100%" border="0" bgcolor="white" style="border: 1px solid #C0C0C0; border-collapse: collapse; margin: 2px padding: 2px;">
 <thead>
  <tr>
   <th colspan="4" bgcolor="#F0F0F0" style="border-bottom: 1px solid #C0C0C0; font-size: 9pt; padding: 4px 8px; text-align: left;">
    <a href="https://reviewboard.asterisk.org/r/2136/diff/3/?file=31581#file31581line274" style="color: black; font-weight: bold; text-decoration: underline;">/branches/1.8/main/db.c</a>
    <span style="font-weight: normal;">

     (Diff revision 3)

    </span>
   </th>
  </tr>
 </thead>

 <tbody style="background-color: #e4d9cb; padding: 4px 8px; text-align: center;">
  <tr>

   <td colspan="4"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">int ast_db_put(const char *family, const char *keys, const char *value)</pre></td>

  </tr>
 </tbody>



 
 




 <tbody>

  <tr>
    <th bgcolor="#e9eaa8" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2">274</font></th>
    <td bgcolor="#fdfebc" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "><span class="kt">int</span> <span class="nf"><span class="hl">ast_</span>db_get</span><span class="p">(</span><span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">family</span><span class="p">,</span> <span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">keys</span><span class="p">,</span> <span class="kt">char</span> <span class="o">*</span><span class="n"><span class="hl">value</span></span><span class="p">,</span> <span class="kt">int</span> <span class="n"><span class="hl">value</span>len</span><span class="p">)</span></pre></td>
    <th bgcolor="#e9eaa8" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">274</font></th>
    <td bgcolor="#fdfebc" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "><span class="k"><span class="hl">static</span></span><span class="hl"> </span><span class="kt">int</span> <span class="nf">db_get<span class="hl">_common</span></span><span class="p">(</span><span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">family</span><span class="p">,</span> <span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">keys</span><span class="p">,</span> <span class="kt">char</span> <span class="o">*<span class="hl">*</span></span><span class="n"><span class="hl">buffer</span></span><span class="p">,</span> <span class="kt">int</span> <span class="n"><span class="hl">buffer</span>len</span><span class="p">)</span></pre></td>
  </tr>

 </tbody>

</table>

  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">I recommend adding doxygen to this new function.</pre>
 </blockquote>





</blockquote>
<pre style="margin-left: 1em; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Thanks Mark, I am working on ASTERISK-20259 and like to see that someone still cares. </pre>
<br />




<p>- lathama</p>


<br />
<p>On October 1st, 2012, 9:23 a.m., Sean Bright wrote:</p>






<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" style="background-image: url('https://reviewboard.asterisk.org/media/rb/images/review_request_box_top_bg.png'); background-position: left top; background-repeat: repeat-x; border: 1px black solid;">
 <tr>
  <td>

<div>Review request for Asterisk Developers.</div>
<div>By Sean Bright.</div>


<p style="color: grey;"><i>Updated Oct. 1, 2012, 9:23 a.m.</i></p>




<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
 <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Greenlight in #asterisk brought up that he was receiving an error message &quot;Could not create persistent member string, out of space&quot; 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&#39;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()&#39;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 &quot;Ship It&quot; but I would like a secondary review since I updated the diff.  I&#39;m not sure that the ast_assert that I added in ast_db_get is a safe change.</pre>
  </td>
 </tr>
</table>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Testing </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
 <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Compiles and basic functional testing.</pre>
  </td>
 </tr>
</table>




<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> </h1>
<ul style="margin-left: 3em; padding-left: 0;">

 <li>/branches/1.8/tests/test_db.c <span style="color: grey">(374095)</span></li>

 <li>/branches/1.8/main/db.c <span style="color: grey">(374095)</span></li>

 <li>/branches/1.8/include/asterisk/astdb.h <span style="color: grey">(374095)</span></li>

 <li>/branches/1.8/apps/app_queue.c <span style="color: grey">(374095)</span></li>

</ul>

<p><a href="https://reviewboard.asterisk.org/r/2136/diff/" style="margin-left: 3em;">View Diff</a></p>




  </td>
 </tr>
</table>








  </div>
 </body>
</html>