diff options
author | zuul <zuul@gerrit.asterisk.org> | 2016-07-12 15:28:26 -0500 |
---|---|---|
committer | Gerrit Code Review <gerrit2@gerrit.digium.api> | 2016-07-12 15:28:26 -0500 |
commit | f3b7339260895d2aba2a2413917f85bf03ee19ea (patch) | |
tree | 42e665e8465943652f5375ee8aac71bc61954e95 /res | |
parent | 5ee205d8bb0dfbae5be89661aa3a787fbdf9986b (diff) | |
parent | 17efed6cf77d936c8e007c5d6afcd37acdc5b880 (diff) |
Merge "func_odbc: Fix connection deadlock." into 13
Diffstat (limited to 'res')
-rw-r--r-- | res/res_odbc.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/res/res_odbc.c b/res/res_odbc.c index b2204ff09..31ea29b03 100644 --- a/res/res_odbc.c +++ b/res/res_odbc.c @@ -744,6 +744,22 @@ static int aoro2_class_cb(void *obj, void *arg, int flags) return 0; } +unsigned int ast_odbc_get_max_connections(const char *name) +{ + struct odbc_class *class; + unsigned int max_connections; + + class = ao2_callback(class_container, 0, aoro2_class_cb, (char *) name); + if (!class) { + return 0; + } + + max_connections = class->maxconnections; + ao2_ref(class, -1); + + return max_connections; +} + /* * \brief Determine if the connection has died. * |