Skip to content

Added error reporting to session code #165

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

Closed
wants to merge 3 commits into from
Closed
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
Next Next commit
Added error reporting to session code
  • Loading branch information
dyeldandi committed Feb 18, 2015
commit 4d06c0355556ed9394ab81819d749d5ad10923d7
7 changes: 6 additions & 1 deletion php_memcached_session.c
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,11 @@ PS_READ_FUNC(memcached)
*vallen = payload_len;
free(payload);
return SUCCESS;
} else {
} else if (status == MEMCACHED_NOTFOUND) {
/* this is okey, session may not be in memcached yet */
return FAILURE;
} else {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "error getting session from memcached: %s", memcached_last_error_message(memc_sess->memc_sess));
return FAILURE;
}
}
Expand Down Expand Up @@ -356,6 +360,7 @@ PS_WRITE_FUNC(memcached)
if (status == 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));
write_try_attempts--;
}
} while (write_try_attempts > 0);
Expand Down