Skip to content

Fixes for PECL bugs 60500 and 60501 #4

New issue

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

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

Already on GitHub? # to your account

Closed
wants to merge 2 commits into from
Closed

Fixes for PECL bugs 60500 and 60501 #4

wants to merge 2 commits into from

Conversation

trvrnrth
Copy link
Contributor

60500: Fix get with CAS token not fetching all results

60501: Add binary protocol support to session handler

Further details are available in the commit messages/bug reports.

Trevor North added 2 commits December 12, 2011 16:48
When performing a get with a cas token requested a multi-get is
performed internally.  After doing so only the first result is fetched,
leaving the final RES_END result on the stack. As per the libmemcached
documentation memcached_fetch_result should be called until it returns
NULL following a multi-get.

In some circumstances this is not noticeable as libmemcached takes care
of flushing the receive buffers accordingly, however certain subsequent
operations will incorrectly return the left-over RES_END result.

I have seen this behaviour exhibited when performing a get with cas
token request followed by an add operation though there may be other
examples.

I have tested this with memcached extension version 2.0.0b2 using
libmemcached 0.53 and 1.0.2, though I believe the issue also exists with
earlier versions.

This commit addresses the issue by performing the necessary fetches and
simplifies the call in the case that a cas token is not required  by
calling memcached_get_by_key.
@ghost
Copy link

ghost commented Apr 2, 2012

Can somebody merge this?

@ccampbell
Copy link

Just confirmed that this also fixes a bug when using Memcached::cas with Memcached::OPT_BINARY_PROTOCOL enabled where the response code is always RES_END.

@marc-mabe
Copy link

Why such PRs don't get merged without a comment?
This project is a highly used and official php extension with 4 members and no one can take 10 min to take a look into this 👎

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants