{"action":"opened","issue":{"url":"https://api.github.com/repos/redis/hiredis/issues/476","repository_url":"https://api.github.com/repos/redis/hiredis","labels_url":"https://api.github.com/repos/redis/hiredis/issues/476/labels{/name}","comments_url":"https://api.github.com/repos/redis/hiredis/issues/476/comments","events_url":"https://api.github.com/repos/redis/hiredis/issues/476/events","html_url":"https://github.com/redis/hiredis/issues/476","id":183325678,"number":476,"title":"Use hiredis connection mysql and it successed","user":{"login":"zhaowq32","id":21306664,"avatar_url":"https://avatars.githubusercontent.com/u/21306664?v=3","gravatar_id":"","url":"https://api.github.com/users/zhaowq32","html_url":"https://github.com/zhaowq32","followers_url":"https://api.github.com/users/zhaowq32/followers","following_url":"https://api.github.com/users/zhaowq32/following{/other_user}","gists_url":"https://api.github.com/users/zhaowq32/gists{/gist_id}","starred_url":"https://api.github.com/users/zhaowq32/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zhaowq32/subscriptions","organizations_url":"https://api.github.com/users/zhaowq32/orgs","repos_url":"https://api.github.com/users/zhaowq32/repos","events_url":"https://api.github.com/users/zhaowq32/events{/privacy}","received_events_url":"https://api.github.com/users/zhaowq32/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-10-17T04:59:26Z","updated_at":"2016-10-17T04:59:26Z","closed_at":null,"body":"mysql port is 60005,redis port is 60006.\r\n\r\nexecute redisPub->connect() is successful but execute redisFree function fails\r\n```\r\nRedisPub *redisPub = new RedisPub(\"127.0.0.1\", 60005, \"\", 5);\r\nif (redisPub->connect()) {\r\n    TRACE(\"connect success.\");\r\n} else {\r\n    TRACE(\"connect fail.\");\r\n    delete redisPub;\r\n    return false;\r\n}\r\n```\r\n```\r\nbool RedisPub::connect() {\r\n    bool bRet = false;\r\n    struct timeval timeoutVal;\r\n    timeoutVal.tv_sec = mTimeout;\r\n    timeoutVal.tv_usec = 0;\r\n\r\n    mRedisCtx = redisConnectWithTimeout(mHost.c_str(), mPort, timeoutVal);\r\n    if (NULL == mRedisCtx || mRedisCtx->err) {\r\n        if (mRedisCtx) {\r\n            TRACE(\"Connect Redis Server ERROR! [ErrorMsg:%s]\\n\",\r\n                    mRedisCtx->errstr);\r\n        } else {\r\n            TRACE(\"Can't allocate redis context\\n\");\r\n        }\r\n        return false;\r\n    } else {\r\n        if (0 == mPass.size()) {\r\n            bRet = true;\r\n        } else {\r\n            redisReply *reply = static_cast<redisReply *>(redisCommand(\r\n                    mRedisCtx, \"AUTH %s\", mPass.c_str()));\r\n            if ((NULL == reply) || (strcasecmp(reply->str, \"OK\") != 0)) {\r\n                bRet = false;\r\n            }\r\n            freeReplyObject(reply);\r\n        }\r\n    }\r\n    return bRet;\r\n}\r\n```\r\n"}}
{"actor":{"display_login":"zhaowq32"}}