<p>N A has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/19364">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">db: Fix incorrect DB tree count for AMI.<br><br>The DBGetTree AMI action's ListItem previously<br>always reported 1, regardless of the count. This<br>is corrected to report the actual count.<br><br>ASTERISK-30245 #close<br>patches:<br>  gettreecount.diff submitted by Birger Harzenetter (license 5870)<br><br>Change-Id: I46d8992710f1b8524426b1255f57d1ef4a4934d4<br>---<br>M main/db.c<br>1 file changed, 20 insertions(+), 1 deletion(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/64/19364/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/main/db.c b/main/db.c</span><br><span>index 2ad430e..a807fdd 100644</span><br><span>--- a/main/db.c</span><br><span>+++ b/main/db.c</span><br><span>@@ -999,6 +999,7 @@</span><br><span>         const char *family = astman_get_header(m, "Family");</span><br><span>       const char *key = astman_get_header(m, "Key");</span><br><span>     sqlite3_stmt *stmt = gettree_stmt;</span><br><span style="color: hsl(120, 100%, 40%);">+    int count = 0;</span><br><span> </span><br><span>   if (!ast_strlen_zero(family) && !ast_strlen_zero(key)) {</span><br><span>             /* Family and key tree */</span><br><span>@@ -1044,12 +1045,13 @@</span><br><span>                  "%s"</span><br><span>                       "\r\n",</span><br><span>                    key_s, value_s, idText);</span><br><span style="color: hsl(120, 100%, 40%);">+              count++;</span><br><span>     }</span><br><span> </span><br><span>        sqlite3_reset(stmt);</span><br><span>         ast_mutex_unlock(&dblock);</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-      astman_send_list_complete_start(s, m, "DBGetTreeComplete", 1);</span><br><span style="color: hsl(120, 100%, 40%);">+      astman_send_list_complete_start(s, m, "DBGetTreeComplete", count);</span><br><span>         astman_send_list_complete_end(s);</span><br><span> </span><br><span>        return 0;</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/19364">change 19364</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.asterisk.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.asterisk.org/c/asterisk/+/19364"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 19 </div>
<div style="display:none"> Gerrit-Change-Id: I46d8992710f1b8524426b1255f57d1ef4a4934d4 </div>
<div style="display:none"> Gerrit-Change-Number: 19364 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: N A <mail@interlinked.x10host.com> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>