aboutsummaryrefslogtreecommitdiffstats
path: root/res/res_odbc.c
AgeCommit message (Collapse)AuthorFilesLines
2009-10-06Merged revisions 222176 via svnmerge from kpfleming1-0/+7
https://origsvn.digium.com/svn/asterisk/trunk ................ r222176 | kpfleming | 2009-10-05 20:24:24 -0500 (Mon, 05 Oct 2009) | 27 lines Recorded merge of revisions 222152 via svnmerge from 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: http://svn.digium.com/svn/asterisk/branches/1.6.2@222187 f38db490-d61c-443f-a65b-d21fe96a405b
2009-08-10AST-2009-005tilghman1-2/+2
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.2@211580 f38db490-d61c-443f-a65b-d21fe96a405b
2009-04-01Merged revisions 185912 via svnmerge from tilghman1-2/+3
https://origsvn.digium.com/svn/asterisk/trunk ........ r185912 | tilghman | 2009-04-01 15:13:28 -0500 (Wed, 01 Apr 2009) | 4 lines Merge changes from str_substitution that are unrelated to that branch. Included is a small bugfix to an ast_str helper, but most of these changes are simply doxygen fixes. ........ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.2@185947 f38db490-d61c-443f-a65b-d21fe96a405b
2009-02-25Oops, wrong direction of commandtilghman1-1/+1
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@178573 f38db490-d61c-443f-a65b-d21fe96a405b
2009-02-19ODBC transaction supporttilghman1-71/+785
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@177320 f38db490-d61c-443f-a65b-d21fe96a405b
2009-02-17Add assertions in the quest to track down a refcount leak.tilghman1-7/+26
(closes issue #14485) Reported by: davevg git-svn-id: http://svn.digium.com/svn/asterisk/trunk@176592 f38db490-d61c-443f-a65b-d21fe96a405b
2009-01-19ast_str_SQLGetData is *not* part of the ast_str API, it's part of the ↵kpfleming1-0/+17
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: http://svn.digium.com/svn/asterisk/trunk@169438 f38db490-d61c-443f-a65b-d21fe96a405b
2009-01-15remove the PBX_ODBC logic from the configure script, and add GENERIC_ODCB ↵kpfleming1-3/+1
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: http://svn.digium.com/svn/asterisk/trunk@168734 f38db490-d61c-443f-a65b-d21fe96a405b
2008-12-18Fix crashes in res_odbc.mmichelson1-2/+2
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: http://svn.digium.com/svn/asterisk/trunk@165724 f38db490-d61c-443f-a65b-d21fe96a405b
2008-12-18Fix reference counts of the class and add an assertion to the end.tilghman1-3/+12
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@165541 f38db490-d61c-443f-a65b-d21fe96a405b
2008-12-17Fix a refcount leak in res_odbcmmichelson1-0/+1
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@165330 f38db490-d61c-443f-a65b-d21fe96a405b
2008-12-05Janitor, use ARRAY_LEN() when possible.eliel1-1/+1
(closes issue #13990) Reported by: eliel Patches: array_len.diff uploaded by eliel (license 64) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@161218 f38db490-d61c-443f-a65b-d21fe96a405b
2008-11-04improve configure script to remember the previous value of each dependency ↵kpfleming1-1/+1
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: http://svn.digium.com/svn/asterisk/trunk@154151 f38db490-d61c-443f-a65b-d21fe96a405b
2008-10-08Keep up with shadow warnings. One day I'll actually enable this in the ↵seanbright1-2/+2
Makefile. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@147457 f38db490-d61c-443f-a65b-d21fe96a405b
2008-10-06All ODBC parts can now use either unixodbc or iodbc.mvanbaak1-1/+3
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: http://svn.digium.com/svn/asterisk/trunk@146925 f38db490-d61c-443f-a65b-d21fe96a405b
2008-10-02Merged revisions 145751 via svnmerge from tilghman1-9/+15
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: http://svn.digium.com/svn/asterisk/trunk@145752 f38db490-d61c-443f-a65b-d21fe96a405b
2008-09-12Create a new config file status, CONFIG_STATUS_FILEINVALID for differentiatingtilghman1-1/+1
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: http://svn.digium.com/svn/asterisk/trunk@142992 f38db490-d61c-443f-a65b-d21fe96a405b
2008-08-11Merged revisions 137138 via svnmerge from tilghman1-3/+14
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: http://svn.digium.com/svn/asterisk/trunk@137150 f38db490-d61c-443f-a65b-d21fe96a405b
2008-08-10All of the res/ stuff (other than res_jabber) from the RSW branch.seanbright1-8/+8
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@137028 f38db490-d61c-443f-a65b-d21fe96a405b
2008-07-11a small change to make things compilemurf1-1/+1
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@130296 f38db490-d61c-443f-a65b-d21fe96a405b
2008-07-11Don't copy on NULL.tilghman1-3/+5
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@130234 f38db490-d61c-443f-a65b-d21fe96a405b
2008-07-11Add some debug code and add a missing releasetilghman1-0/+25
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@130232 f38db490-d61c-443f-a65b-d21fe96a405b
2008-06-10Move the table cache routines to res_odbc, so they can be used from othertilghman1-0/+169
places (app_voicemail, for example). (Related to bug #11678) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@121683 f38db490-d61c-443f-a65b-d21fe96a405b
2008-05-23Protect the object from changing while the 'odbc show' CLI command is runningtilghman1-0/+4
(Closes issue #12704) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@118129 f38db490-d61c-443f-a65b-d21fe96a405b
2008-05-20Increase limit of unshared connections from 1023 to 4.2 billion.tilghman1-2/+2
(Related to issue #12677) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@117264 f38db490-d61c-443f-a65b-d21fe96a405b
2008-05-20Revert part of previous fix, and heavily comment the logic for objecttilghman1-21/+47
destruction, for future users. (Closes issue #12677) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@117262 f38db490-d61c-443f-a65b-d21fe96a405b
2008-05-19Remove a premature mutex destroy (the destruction callback will end up ↵file1-13/+19
destroying it) and use a callback to purge remaining classes. (closes issue #12677) Reported by: falves11 git-svn-id: http://svn.digium.com/svn/asterisk/trunk@117133 f38db490-d61c-443f-a65b-d21fe96a405b
2008-05-07Don't free the object on destroy, as astobj2 takes care of that for youtilghman1-1/+0
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@115525 f38db490-d61c-443f-a65b-d21fe96a405b
2008-05-05Merge refcounting of res_odbctilghman1-233/+117
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@115337 f38db490-d61c-443f-a65b-d21fe96a405b
2008-02-01Clarify the pooling functionality by changing the config file keywordtilghman1-1/+10
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@101824 f38db490-d61c-443f-a65b-d21fe96a405b
2008-01-23Merged revisions 99775 via svnmerge from tilghman1-1/+1
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: http://svn.digium.com/svn/asterisk/trunk@99776 f38db490-d61c-443f-a65b-d21fe96a405b
2008-01-21Merged revisions 99341 via svnmerge from tilghman1-5/+20
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: http://svn.digium.com/svn/asterisk/trunk@99350 f38db490-d61c-443f-a65b-d21fe96a405b
2008-01-18Permit username and password to be NULL (which enables pass-through from the ↵tilghman1-7/+29
layer above). Reported by: lurcher Patch by: tilghman (Closes issue #11739) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@99017 f38db490-d61c-443f-a65b-d21fe96a405b
2008-01-12Merged revisions 98467 via svnmerge from tilghman1-0/+1
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: http://svn.digium.com/svn/asterisk/trunk@98487 f38db490-d61c-443f-a65b-d21fe96a405b
2007-12-05Use ast_free() instead of free().russell1-1/+1
(closes issue #11309) Reported by: Laureano Patches: res_odbc.c.patch uploaded by Laureano (license 265) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@91131 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-25Merged revisions 89559 via svnmerge from tilghman1-2/+18
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: http://svn.digium.com/svn/asterisk/trunk@89561 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-21remove a bunch of useless #include "options.h"rizzo1-1/+0
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@89511 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-19include "logger.h" and errno.h from asterisk.h - usage shows that theyrizzo1-1/+0
were included almost everywhere. Remove some of the instances. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@89424 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-16Start untangling header inclusion in a way that does not affectrizzo1-5/+0
build times - tested, there is no measureable difference before and after this commit. In this change: use asterisk/compat.h to include a small set of system headers: inttypes.h, unistd.h, stddef.h, stddint.h, sys/types.h, stdarg.h, stdlib.h, alloca.h, stdio.h Where available, the inclusion is conditional on HAVE_FOO_H as determined by autoconf. Normally, source files should not include any of the above system headers, and instead use either "asterisk.h" or "asterisk/compat.h" which does it better. For the time being I have left alone second-level directories (main/db1-ast, etc.). git-svn-id: http://svn.digium.com/svn/asterisk/trunk@89333 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-14One more typo in config.c; and missed conversions due to the constifying of ↵tilghman1-2/+4
ast_variable_new parameters git-svn-id: http://svn.digium.com/svn/asterisk/trunk@89270 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-08improve linked-list macros in two ways:kpfleming1-4/+2
- the *_CURRENT macros no longer need the list head pointer argument - add AST_LIST_MOVE_CURRENT to encapsulate the remove/add operation when moving entries between lists git-svn-id: http://svn.digium.com/svn/asterisk/trunk@89106 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-05Merged revisions 88539 via svnmerge from tilghman1-1/+1
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r88539 | tilghman | 2007-11-05 10:20:13 -0600 (Mon, 05 Nov 2007) | 4 lines Don't check used pooled connections for connection status, as it will cause issues for prepared queries. Reported by: Nick Gorham (via -dev list) Patch by: tilghman ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@88540 f38db490-d61c-443f-a65b-d21fe96a405b
2007-10-22Switch from AST_CLI (formerly NEW_CLI) to AST_CLI_DEFINE, since the former ↵qwell1-1/+1
didn't make much sense git-svn-id: http://svn.digium.com/svn/asterisk/trunk@86820 f38db490-d61c-443f-a65b-d21fe96a405b
2007-10-19Convert NEW_CLI to AST_CLI.qwell1-1/+1
Closes issue #11039, as suggested by seanbright. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@86536 f38db490-d61c-443f-a65b-d21fe96a405b
2007-09-18(issue #10724)qwell1-17/+40
Reported by: eliel Patches: res_features.c.patch uploaded by eliel (license 64) res_agi.c.patch uploaded by seanbright (license 71) res_musiconhold.c.patch uploaded by seanbright (license 71) pbx.c.patch uploaded by moy (license 222) logger.c.patch uploaded by moy (license 222) frame.c.patch uploaded by moy (license 222) manager.c.patch uploaded by moy (license 222) http.c.patch uploaded by moy (license 222) dnsmgr.c.patch uploaded by moy (license 222) res_realtime.c.patch uploaded by eliel (license 64) res_odbc.c.patch uploaded by seanbright (license 71) res_jabber.c.patch uploaded by eliel (license 64) chan_local.c.patch uploaded by eliel (license 64) chan_agent.c.patch uploaded by eliel (license 64) chan_alsa.c.patch uploaded by eliel (license 64) chan_features.c.patch uploaded by eliel (license 64) chan_sip.c.patch uploaded by eliel (license 64) RollUp.1.patch (includes all of the above patches) uploaded by seanbright (license 71) Convert many CLI commands to the NEW_CLI format. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@82930 f38db490-d61c-443f-a65b-d21fe96a405b
2007-09-14Add a direct execute method to res_odbc (closes issue #10722)tilghman1-0/+22
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@82393 f38db490-d61c-443f-a65b-d21fe96a405b
2007-08-16Don't reload a configuration file if nothing has changed.tilghman1-3/+5
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@79747 f38db490-d61c-443f-a65b-d21fe96a405b
2007-08-13Only use the sanitysql if it's not zero-lentilghman1-1/+1
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@79333 f38db490-d61c-443f-a65b-d21fe96a405b
2007-08-11Merged revisions 79142 via svnmerge from tilghman1-2/+10
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r79142 | tilghman | 2007-08-11 00:23:04 -0500 (Sat, 11 Aug 2007) | 2 lines Ensure the connection gets marked as used at allocation time (closes issue #10429, report and fix by mnicholson) ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@79147 f38db490-d61c-443f-a65b-d21fe96a405b
2007-08-07Merged revisions 78437 via svnmerge from tilghman1-3/+0
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r78437 | tilghman | 2007-08-07 14:34:25 -0500 (Tue, 07 Aug 2007) | 2 lines Don't free the environment handle when the connection fails, because other connections might be depending upon it ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@78442 f38db490-d61c-443f-a65b-d21fe96a405b