summaryrefslogtreecommitdiff
path: root/res/res_odbc.c
AgeCommit message (Collapse)Author
2011-02-14Merged revisions 307793 via svnmerge from Tilghman Lesher
https://origsvn.digium.com/svn/asterisk/branches/1.8 ................ r307793 | tilghman | 2011-02-14 14:16:55 -0600 (Mon, 14 Feb 2011) | 15 lines Merged revisions 307792 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.6.2 ........ r307792 | tilghman | 2011-02-14 14:10:28 -0600 (Mon, 14 Feb 2011) | 8 lines Increment usage count at first reference, to avoid a race condition with many threads creating connections all at once. (issue #18156) Reported by: asgaroth Patches: 20110214__issue18156.diff.txt uploaded by tilghman (license 14) Tested by: tilghman ........ ................ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@307795 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-02-04Replace ast_log(LOG_DEBUG, ...) with ast_debug()Paul Belanger
(closes issue #18556) Reported by: kkm Review: https://reviewboard.asterisk.org/r/1071/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@306258 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-01-05Merged revisions 300623 via svnmerge from Tilghman Lesher
https://origsvn.digium.com/svn/asterisk/branches/1.8 ................ r300623 | tilghman | 2011-01-05 12:56:12 -0600 (Wed, 05 Jan 2011) | 24 lines Merged revisions 300622 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.6.2 ................ r300622 | tilghman | 2011-01-05 12:54:58 -0600 (Wed, 05 Jan 2011) | 17 lines Merged revisions 300621 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r300621 | tilghman | 2011-01-05 12:47:46 -0600 (Wed, 05 Jan 2011) | 10 lines Use the sanity check in place of the disconnect/connect cycle. The disconnect/connect cycle has the potential to cause random crashes. (closes issue #18243) Reported by: ks3 Patches: res_odbc.patch uploaded by ks3 (license 1147) Tested by: ks3 ........ ................ ................ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@300624 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-08-26Merged revisions 283659 via svnmerge from Russell Bryant
https://origsvn.digium.com/svn/asterisk/branches/1.8 ........ r283659 | russell | 2010-08-26 08:26:14 -0500 (Thu, 26 Aug 2010) | 2 lines Slight improvement to a debug message. ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@283660 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-08-25Merged revisions 283561 via svnmerge from Tilghman Lesher
https://origsvn.digium.com/svn/asterisk/branches/1.8 ........ r283561 | tilghman | 2010-08-25 11:12:43 -0500 (Wed, 25 Aug 2010) | 5 lines Initialize connect timeout on each time through the loop. (closes issue #17911) Reported by: wurstsalat ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@283562 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-07-23Merged revisions 279113 via svnmerge from Tilghman Lesher
https://origsvn.digium.com/svn/asterisk/branches/1.8 ........ r279113 | tilghman | 2010-07-23 13:56:04 -0500 (Fri, 23 Jul 2010) | 2 lines Silly 64-bit compilers (who uses 64-bit anyway?) ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@279115 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-07-23Merge the realtime failover branchTilghman Lesher
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@278957 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-07-20Add load priority order, such that preload becomes unnecessary in most casesTilghman Lesher
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@278132 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-07-08Implement AstData API data providers as part of the GSOC 2010 project,Eliel C. Sardanons
midterm evaluation. Review: https://reviewboard.asterisk.org/r/757/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@274727 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-04-22Remove ABI differences that occured when compiling with DEBUG_THREADS.Jason Parker
"Bad Things" would happen if Asterisk was compiled with DEBUG_THREADS, but a loaded module was not (or vice versa). This also immensely simplifies the lock code, since there are no longer 2 separate versions of them. Review: https://reviewboard.asterisk.org/r/508/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@258557 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-10-06Recorded merge of revisions 222152 via svnmerge from Kevin P. Fleming
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r222152 | kpfleming | 2009-10-05 20:16:36 -0500 (Mon, 05 Oct 2009) | 20 lines Fix ao2_iterator API to hold references to containers being iterated. See Mantis issue for details of what prompted this change. Additional notes: This patch changes the ao2_iterator API in two ways: F_AO2I_DONTLOCK has become an enum instead of a macro, with a name that fits our naming policy; also, it is now necessary to call ao2_iterator_destroy() on any iterator that has been created. Currently this only releases the reference to the container being iterated, but in the future this could also release other resources used by the iterator, if the iterator implementation changes to use additional resources. (closes issue #15987) Reported by: kpfleming Review: https://reviewboard.asterisk.org/r/383/ ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@222176 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-08-10AST-2009-005Tilghman Lesher
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@211539 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-21Const-ify the world (or at least a good part of it)Kevin P. Fleming
This patch adds 'const' tags to a number of Asterisk APIs where they are appropriate (where the API already demanded that the function argument not be modified, but the compiler was not informed of that fact). The list includes: - CLI command handlers - CLI command handler arguments - AGI command handlers - AGI command handler arguments - Dialplan application handler arguments - Speech engine API function arguments In addition, various file-scope and function-scope constant arrays got 'const' and/or 'static' qualifiers where they were missing. Review: https://reviewboard.asterisk.org/r/251/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@196072 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-12add 'const' qualifiers in various places where they should have beenKevin P. Fleming
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@193832 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-01Merge changes from str_substitution that are unrelated to that branch.Tilghman Lesher
Included is a small bugfix to an ast_str helper, but most of these changes are simply doxygen fixes. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@185912 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-18a few more namespace updates... res_ael_share still needs some work before ↵Kevin P. Fleming
this can be merged to other release branches git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@182848 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-25Oops, wrong direction of commandTilghman Lesher
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@178573 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-19ODBC transaction supportTilghman Lesher
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@177320 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-17Add assertions in the quest to track down a refcount leak.Tilghman Lesher
(closes issue #14485) Reported by: davevg git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@176592 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-01-19ast_str_SQLGetData is *not* part of the ast_str API, it's part of the ↵Kevin P. Fleming
ast_odbc API and just happens to use an ast_str as the buffer; move all of it to res_odbc.c and res_odbc.h, renaming appropriately along the way fix some minor coding style issues in strings.h and add some attribute_pure annotations to functions in the ast_str API git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@169438 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-01-15remove the PBX_ODBC logic from the configure script, and add GENERIC_ODCB ↵Kevin P. Fleming
logic that includes copying the relevant LIB and INCLUDE data from either UnixODBC or iODBC, based on which was found; if both were found, prefer UnixODBC this stops modules from being linked against both sets of libraries on systems that have both installed git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@168734 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-18Fix crashes in res_odbc.Mark Michelson
The variable "class" was being set NULL just prior to being dereferenced in an ao2_link call. I have moved the setting of the variable to NULL until after the ao2_link call. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@165724 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-18Fix reference counts of the class and add an assertion to the end.Tilghman Lesher
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@165541 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-17Fix a refcount leak in res_odbcMark Michelson
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@165330 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-05Janitor, use ARRAY_LEN() when possible.Eliel C. Sardanons
(closes issue #13990) Reported by: eliel Patches: array_len.diff uploaded by eliel (license 64) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@161218 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-04improve configure script to remember the previous value of each dependency ↵Kevin P. Fleming
in build_tools/menuselect-deps, so that (once it has been written) menuselect can use this information to warn the user when a previously met dependency is no longer met along the way, change tags used in configure script, menuselect-deps and code for various dependencies to be consistently named git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@154151 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-08Keep up with shadow warnings. One day I'll actually enable this in the ↵Sean Bright
Makefile. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@147457 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-06All ODBC parts can now use either unixodbc or iodbc.Michiel van Baak
This allows for the ODBC parts to work on OpenBSD as well. 99.99% of the work is done by seanbright (bow, bow) and I actually did nothing but test and yell at him that it still didn't work :) Thanks for helping out ! git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@146925 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-02Merged revisions 145751 via svnmerge from Tilghman Lesher
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r145751 | tilghman | 2008-10-02 10:13:21 -0500 (Thu, 02 Oct 2008) | 3 lines Some sanity checks that may have led to prior crashes, found by codefreeze-lap (murf) on IRC. Also some cleanup of incorrectly-used constants. ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@145752 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-09-12Create a new config file status, CONFIG_STATUS_FILEINVALID for differentiatingTilghman Lesher
when a file is invalid from when a file is missing. This is most important when we have two configuration files. Consider the following example: Old system: sip.conf users.conf Old result New result ======== ========== ========== ========== Missing Missing SIP doesn't load SIP doesn't load Missing OK SIP doesn't load SIP doesn't load Missing Invalid SIP doesn't load SIP doesn't load OK Missing SIP loads SIP loads OK OK SIP loads SIP loads OK Invalid SIP loads incompletely SIP doesn't load Invalid Missing SIP doesn't load SIP doesn't load Invalid OK SIP doesn't load SIP doesn't load Invalid Invalid SIP doesn't load SIP doesn't load So in the case when users.conf doesn't load because there's a typo that disrupts the syntax, we may only partially load users, instead of failing with an error, which may cause some calls not to get processed. Worse yet, the old system would do this with no indication that anything was even wrong. (closes issue #10690) Reported by: dtyoo Patches: 20080716__bug10690.diff.txt uploaded by Corydon76 (license 14) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@142992 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-08-11Merged revisions 137138 via svnmerge from Tilghman Lesher
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r137138 | tilghman | 2008-08-10 19:20:38 -0500 (Sun, 10 Aug 2008) | 5 lines Deallocate database connection handle on disconnect, as we allocate another one on connect. (closes issue #13271) Reported by: dveiga ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@137150 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-08-10All of the res/ stuff (other than res_jabber) from the RSW branch.Sean Bright
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@137028 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-11a small change to make things compileSteve Murphy
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@130296 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-11Don't copy on NULL.Tilghman Lesher
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@130234 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-11Add some debug code and add a missing releaseTilghman Lesher
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@130232 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-10Move the table cache routines to res_odbc, so they can be used from otherTilghman Lesher
places (app_voicemail, for example). (Related to bug #11678) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@121683 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-23Protect the object from changing while the 'odbc show' CLI command is runningTilghman Lesher
(Closes issue #12704) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@118129 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-20Increase limit of unshared connections from 1023 to 4.2 billion.Tilghman Lesher
(Related to issue #12677) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@117264 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-20Revert part of previous fix, and heavily comment the logic for objectTilghman Lesher
destruction, for future users. (Closes issue #12677) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@117262 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-19Remove a premature mutex destroy (the destruction callback will end up ↵Joshua Colp
destroying it) and use a callback to purge remaining classes. (closes issue #12677) Reported by: falves11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@117133 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-07Don't free the object on destroy, as astobj2 takes care of that for youTilghman Lesher
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@115525 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-05Merge refcounting of res_odbcTilghman Lesher
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@115337 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-02-01Clarify the pooling functionality by changing the config file keywordTilghman Lesher
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@101824 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-23Merged revisions 99775 via svnmerge from Tilghman Lesher
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r99775 | tilghman | 2008-01-22 22:20:15 -0600 (Tue, 22 Jan 2008) | 2 lines Oops, should have checked for a NULL obj, here, too ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@99776 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-21Merged revisions 99341 via svnmerge from Tilghman Lesher
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r99341 | tilghman | 2008-01-21 12:11:07 -0600 (Mon, 21 Jan 2008) | 8 lines Permit the user to specify number of seconds that a connection may remain idle, which fixes a crash on reconnect with the MyODBC driver. (closes issue #11798) Reported by: Corydon76 Patches: 20080119__res_odbc__idlecheck.diff.txt uploaded by Corydon76 (license 14) Tested by: mvanbaak ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@99350 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-18Permit username and password to be NULL (which enables pass-through from the ↵Tilghman Lesher
layer above). Reported by: lurcher Patch by: tilghman (Closes issue #11739) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@99017 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-12Merged revisions 98467 via svnmerge from Tilghman Lesher
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r98467 | tilghman | 2008-01-11 18:05:08 -0600 (Fri, 11 Jan 2008) | 4 lines Add a connection timeout attribute, as that was what was intended with the login timeout, but ODBC divides it up into 2 different timeouts. (Closes issue #11745) ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@98487 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-05Use ast_free() instead of free().Russell Bryant
(closes issue #11309) Reported by: Laureano Patches: res_odbc.c.patch uploaded by Laureano (license 265) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@91131 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-25Merged revisions 89559 via svnmerge from Tilghman Lesher
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r89559 | tilghman | 2007-11-25 11:17:10 -0600 (Sun, 25 Nov 2007) | 14 lines We previously attempted to use the ESCAPE clause to set the escape delimiter to a backslash. Unfortunately, this does not universally work on all databases, since on databases which natively use the backslash as a delimiter, the backslash itself needs to be delimited, but on other databases that have no delimiter, backslashing the backslash causes an error. So the only solution that I can come up with is to create an option in res_odbc that explicitly specifies whether or not backslash is a native delimiter. If it is, we use it natively; if not, we use the ESCAPE clause to make it one. Reported by: elguero Patch by: tilghman (Closes issue #11364) ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89561 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-21remove a bunch of useless #include "options.h"Luigi Rizzo
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89511 65c4cc65-6c06-0410-ace0-fbb531ad65f3