Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
f6baeb21
提交
f6baeb21
authored
11月 20, 2012
作者:
Anthony Minessale
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
bump
上级
1d7623c9
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
50 行增加
和
15 行删除
+50
-15
configure.in
configure.in
+2
-2
switch_pgsql.h
src/include/switch_pgsql.h
+2
-0
switch_core_sqldb.c
src/switch_core_sqldb.c
+12
-1
switch_pgsql.c
src/switch_pgsql.c
+34
-12
没有找到文件。
configure.in
浏览文件 @
f6baeb21
...
...
@@ -3,10 +3,10 @@
# Must change all of the below together
# For a release, set revision for that tagged release as well and uncomment
AC_INIT([freeswitch], [1.3.5
b
], bugs@freeswitch.org)
AC_INIT([freeswitch], [1.3.5], bugs@freeswitch.org)
AC_SUBST(SWITCH_VERSION_MAJOR, [1])
AC_SUBST(SWITCH_VERSION_MINOR, [3])
AC_SUBST(SWITCH_VERSION_MICRO, [5
b
])
AC_SUBST(SWITCH_VERSION_MICRO, [5])
AC_SUBST(SWITCH_VERSION_REVISION, [])
AC_SUBST(SWITCH_VERSION_REVISION_HUMAN, [])
...
...
src/include/switch_pgsql.h
浏览文件 @
f6baeb21
...
...
@@ -156,6 +156,8 @@ SWITCH_DECLARE(switch_pgsql_status_t) switch_pgsql_handle_callback_exec_detailed
SWITCH_DECLARE
(
char
*
)
switch_pgsql_handle_get_error
(
switch_pgsql_handle_t
*
handle
);
SWITCH_DECLARE
(
int
)
switch_pgsql_handle_affected_rows
(
switch_pgsql_handle_t
*
handle
);
SWITCH_DECLARE
(
switch_pgsql_status_t
)
switch_pgsql_flush
(
switch_pgsql_handle_t
*
handle
);
SWITCH_END_EXTERN_C
#endif
...
...
src/switch_core_sqldb.c
浏览文件 @
f6baeb21
...
...
@@ -293,6 +293,17 @@ SWITCH_DECLARE(void) switch_cache_db_flush_handles(void)
SWITCH_DECLARE
(
void
)
switch_cache_db_release_db_handle
(
switch_cache_db_handle_t
**
dbh
)
{
if
(
dbh
&&
*
dbh
)
{
switch
((
*
dbh
)
->
type
)
{
case
SCDB_TYPE_PGSQL
:
{
switch_pgsql_flush
((
*
dbh
)
->
native_handle
.
pgsql_dbh
);
}
break
;
default
:
break
;
}
switch_mutex_lock
(
sql_manager
.
dbh_mutex
);
(
*
dbh
)
->
last_used
=
switch_epoch_time_now
(
NULL
);
...
...
@@ -406,7 +417,7 @@ SWITCH_DECLARE(switch_status_t) _switch_cache_db_get_db_handle(switch_cache_db_h
switch
(
type
)
{
case
SCDB_TYPE_PGSQL
:
{
db_name
=
connection_options
->
odbc
_options
.
dsn
;
db_name
=
connection_options
->
pgsql
_options
.
dsn
;
odbc_user
=
NULL
;
odbc_pass
=
NULL
;
}
...
...
src/switch_pgsql.c
浏览文件 @
f6baeb21
...
...
@@ -276,11 +276,8 @@ SWITCH_DECLARE(switch_pgsql_status_t) switch_pgsql_cancel_real(const char *file,
ret
=
SWITCH_PGSQL_FAIL
;
}
PQfreeCancel
(
cancel
);
{
PGresult
*
tmp
=
NULL
;
/* Make sure the query is fully cancelled */
while
((
tmp
=
PQgetResult
(
handle
->
con
))
!=
NULL
)
PQclear
(
tmp
);
}
switch_pgsql_flush
(
handle
);
#endif
return
ret
;
}
...
...
@@ -427,14 +424,13 @@ SWITCH_DECLARE(switch_pgsql_status_t) switch_pgsql_next_result_timed(switch_pgsq
return
SWITCH_PGSQL_SUCCESS
;
error
:
{
PGresult
*
tmp
=
NULL
;
/* Make sure the failed connection does not have any transactions marked as in progress */
while
((
tmp
=
PQgetResult
(
handle
->
con
))
!=
NULL
)
PQclear
(
tmp
);
/* Try to reconnect to the DB if we were dropped */
db_is_up
(
handle
);
}
/* Make sure the failed connection does not have any transactions marked as in progress */
switch_pgsql_flush
(
handle
);
/* Try to reconnect to the DB if we were dropped */
db_is_up
(
handle
);
#endif
return
SWITCH_PGSQL_FAIL
;
}
...
...
@@ -572,6 +568,9 @@ SWITCH_DECLARE(switch_pgsql_status_t) switch_pgsql_handle_exec_base_detailed(con
#ifdef SWITCH_HAVE_PGSQL
char
*
err_str
=
NULL
,
*
er
=
NULL
;
switch_pgsql_flush
(
handle
);
handle
->
affected_rows
=
0
;
if
(
!
db_is_up
(
handle
))
{
...
...
@@ -829,6 +828,29 @@ SWITCH_DECLARE(switch_pgsql_status_t) switch_pgsql_SQLSetAutoCommitAttr(switch_p
#endif
}
SWITCH_DECLARE
(
switch_pgsql_status_t
)
switch_pgsql_flush
(
switch_pgsql_handle_t
*
handle
)
{
#ifdef SWITCH_HAVE_PGSQL
PGresult
*
tmp
=
NULL
;
int
x
=
0
;
/* Make sure the query is fully cleared */
while
((
tmp
=
PQgetResult
(
handle
->
con
))
!=
NULL
)
{
PQclear
(
tmp
);
x
++
;
}
if
(
x
)
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_DEBUG10
,
"Flushing %d results
\n
"
,
x
);
}
return
SWITCH_PGSQL_SUCCESS
;
#else
return
(
switch_pgsql_status_t
)
SWITCH_FALSE
;
#endif
}
SWITCH_DECLARE
(
switch_pgsql_status_t
)
switch_pgsql_SQLEndTran
(
switch_pgsql_handle_t
*
handle
,
switch_bool_t
commit
)
{
#ifdef SWITCH_HAVE_PGSQL
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论