projects
/
m6w6
/
ext-pq
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
|
github
raw
|
patch
| inline |
side by side
(parent:
280761d
)
ping server and eventually reset conn on wakeup
author
Michael Wallner
<mike@php.net>
Sat, 13 Sep 2014 06:56:29 +0000
(08:56 +0200)
committer
Michael Wallner
<mike@php.net>
Sat, 13 Sep 2014 06:56:29 +0000
(08:56 +0200)
src/php_pqconn.c
patch
|
blob
|
history
diff --git
a/src/php_pqconn.c
b/src/php_pqconn.c
index 2588d42f0fb09d9739f072bce180503b7630bb70..dedd1f4c4a41701e59ce6ed05a820dbd9eeb7a8f 100644
(file)
--- a/
src/php_pqconn.c
+++ b/
src/php_pqconn.c
@@
-541,7
+541,12
@@
php_resource_factory_ops_t *php_pqconn_get_resource_factory_ops(void)
static void php_pqconn_wakeup(php_persistent_handle_factory_t *f, void **handle TSRMLS_DC)
{
- // FIXME: ping server
+ PGresult *res = PQexec(*handle, "");
+ PHP_PQclear(res);
+
+ if (CONNECTION_OK != PQstatus(*handle)) {
+ PQreset(*handle);
+ }
}
static inline PGresult *unlisten(PGconn *conn, const char *channel_str, size_t channel_len TSRMLS_DC)