8000 Support for setting persistent socket id by Zakay · Pull Request #15 · phpredis/phpredis · GitHub
[go: up one dir, main page]

Skip to content

Support for setting persistent socket id #15

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Jun 12, 2011
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Bugfix: Forgot to allocate memory for persistent_id
  • Loading branch information
Zakay committed Feb 4, 2011
commit bb24d0e01b1ca99088c972b7b59eaa45ddaf6e5d
3 changes: 2 additions & 1 deletion library.c
Original file line number Diff line number Diff line change
Expand Up @@ -755,7 +755,7 @@ PHPAPI void redis_ping_response(INTERNAL_FUNCTION_PARAMETERS, RedisSock *redis_s
*/
PHPAPI RedisSock* redis_sock_create(char *host, int host_len, unsigned short port,
double timeout, int persistent, char *persistent_id,
int persistent_id_len)
int persistent_id_len)
{
RedisSock *redis_sock;

Expand All @@ -767,6 +767,7 @@ PHPAPI RedisSock* redis_sock_create(char *host, int host_len, unsigned short por
redis_sock->persistent = persistent;

if (persistent_id) {
redis_sock->persistent_id = ecalloc(persistent_id_len + 1, 1);
memcpy(redis_sock->persistent_id, persistent_id, persistent_id_len);
redis_sock->persistent_id[persistent_id_len] = '\0';
} else {
Expand Down
0