Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/phpredis/phpredis.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormichael-grunder <michael.grunder@gmail.com>2013-03-27 21:21:18 +0400
committermichael-grunder <michael.grunder@gmail.com>2013-03-27 21:21:18 +0400
commitef792320e7a5acbb7361ab4dfcb9624c115b7e39 (patch)
tree481464ba1e55555ecde7f616b60526f184fba102 /library.c
parentb2ffb7ac753f5fa94d808dbf684a64e9f0e6f8c5 (diff)
Introspection methods
This commit adds methods to get information about the state of our phpredis object, such as what host/port we are connected to, our timeout, etc... The following methods have been added: getHost() getPort() getDBNum() getTimeout() getReadTimeout() isConnected() getPersistentID() getAuth() In addition, there is a small memory leak fix when a persistent id was specifically passed to connect() (it wasn't beeing freed). Addresses issue #320
Diffstat (limited to 'library.c')
-rw-r--r--library.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/library.c b/library.c
index 856a8055..32f77cd6 100644
--- a/library.c
+++ b/library.c
@@ -1283,6 +1283,12 @@ PHPAPI void redis_free_socket(RedisSock *redis_sock)
if(redis_sock->err) {
efree(redis_sock->err);
}
+ if(redis_sock->auth) {
+ efree(redis_sock->auth);
+ }
+ if(redis_sock->persistent_id) {
+ efree(redis_sock->persistent_id);
+ }
efree(redis_sock->host);
efree(redis_sock);
}