Skip to content
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

Added error reporting to session code #301

Merged
merged 2 commits into from
Jan 24, 2017
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
3 changes: 3 additions & 0 deletions php_memcached_session.c
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,7 @@ PS_READ_FUNC(memcached)
*val = ZSTR_EMPTY_ALLOC();
return SUCCESS;
} else {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "error getting session from memcached: %s", memcached_last_error_message(memc_sess->memc_sess));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this can be memc instead of memc_sess->memc_sess

return FAILURE;
}
}
Expand Down Expand Up @@ -470,6 +471,8 @@ PS_WRITE_FUNC(memcached)
do {
if (memcached_set(memc, key->val, key->len, val->val, val->len, expiration, 0) == MEMCACHED_SUCCESS) {
return SUCCESS;
} else {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "error saving session to memcached: %s", memcached_last_error_message(memc_sess->memc_sess));
}
} while (--retries > 0);

Expand Down