]> git.ipfire.org Git - thirdparty/asterisk.git/commit
Fix DBDelTree error codes for AMI, CLI and AGI
authorDavid M. Lee <dlee@digium.com>
Thu, 4 Oct 2012 15:42:07 +0000 (15:42 +0000)
committerDavid M. Lee <dlee@digium.com>
Thu, 4 Oct 2012 15:42:07 +0000 (15:42 +0000)
commit2659db6d619dd298d07c655887c4690de144db80
tree9707a961a1933e91a2289613a4a1f76022d55b43
parent259f43f421b3294454f680de3d7986b2b85d6149
Fix DBDelTree error codes for AMI, CLI and AGI

The AMI DBDelTree command will return Success/Key tree deleted successfully even
if the given key does not exist. The CLI command 'database deltree' had a
similar problem, but was saved because it actually responded with '0 database
entries removed'. AGI had a slightly different error, where it would return
success if the database was unavailable.

This came from confusion about the ast_db_deltree retval, which is -1 in the
event of a database error, or number of entries deleted (including 0 for
deleting nothing).

* Changed some poorly named res variables to num_deleted
* Specified specific errors when calling ast_db_deltree (database unavailable
  vs. entry not found vs. success)
* Fixed similar bug in AGI database deltree, where 'Database unavailable'
  results in successful result

(closes issue AST-967)
Reported by: John Bigelow
Review: https://reviewboard.asterisk.org/r/2138/
........

Merged revisions 374426 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 374427 from http://svn.asterisk.org/svn/asterisk/branches/10

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@374428 65c4cc65-6c06-0410-ace0-fbb531ad65f3
main/db.c
res/res_agi.c