Skip to content

Include a fuller list of response constants from libmemcached #457

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 1 commit into from
Oct 9, 2020

Conversation

SpencerMalone
Copy link
Contributor

So, I ran into a case where I was getting an error code 3 due to misconfiguration, which didn't map to any known error type in the PHP library. This led me to find https://bazaar.launchpad.net/~tangent-trunk/libmemcached/1.0/view/head:/libmemcached-1.0/types/return.h, and as far as I know, this should have been a MEMCACHED_CONNECTION_FAILURE . When I looked around, I noticed we were missing quite a few return types in php-land. I tried to find the ones that were absent and slot them in, and also worked to improve the ordering of most of them by redefining them in the order they were defined in return.h.

Things I don't know: Is this compatible with all supported libmemcached versions? How could I find out? I'm not super familiar with c level stuff, so bear with me here if you can!

@sodabrew
Copy link
Contributor

Thanks! The Travis CI run shows that all supported versions have these constants defined. It is OK if this is the change that causes older versions that happened-to-still-work from no longer compiling.

@sodabrew sodabrew added this to the 3.2.0 milestone Jun 18, 2020
@sodabrew
Copy link
Contributor

sodabrew commented Oct 9, 2020

Took me a while to diff this without whitespace (git diff -w) and sorted to identify just the additions:

+       REGISTER_MEMC_CLASS_CONST_LONG(RES_CONNECTION_BIND_FAILURE,   MEMCACHED_CONNECTION_BIND_FAILURE);
+       REGISTER_MEMC_CLASS_CONST_LONG(RES_CONNECTION_FAILURE,        MEMCACHED_CONNECTION_FAILURE);
+       REGISTER_MEMC_CLASS_CONST_LONG(RES_DATA_DOES_NOT_EXIST,       MEMCACHED_DATA_DOES_NOT_EXIST);
+       REGISTER_MEMC_CLASS_CONST_LONG(RES_DEPRECATED,                MEMCACHED_DEPRECATED);
+       REGISTER_MEMC_CLASS_CONST_LONG(RES_FAIL_UNIX_SOCKET,          MEMCACHED_FAIL_UNIX_SOCKET);
+       REGISTER_MEMC_CLASS_CONST_LONG(RES_INVALID_ARGUMENTS,         MEMCACHED_INVALID_ARGUMENTS);
+       REGISTER_MEMC_CLASS_CONST_LONG(RES_IN_PROGRESS,               MEMCACHED_IN_PROGRESS);
+       REGISTER_MEMC_CLASS_CONST_LONG(RES_MAXIMUM_RETURN,            MEMCACHED_MAXIMUM_RETURN);
+       REGISTER_MEMC_CLASS_CONST_LONG(RES_NO_KEY_PROVIDED,           MEMCACHED_NO_KEY_PROVIDED);
+       REGISTER_MEMC_CLASS_CONST_LONG(RES_PARSE_ERROR,               MEMCACHED_PARSE_ERROR);
+       REGISTER_MEMC_CLASS_CONST_LONG(RES_PARSE_USER_ERROR,          MEMCACHED_PARSE_USER_ERROR);
+       REGISTER_MEMC_CLASS_CONST_LONG(RES_READ_FAILURE,              MEMCACHED_READ_FAILURE);
+       REGISTER_MEMC_CLASS_CONST_LONG(RES_VALUE,                     MEMCACHED_VALUE);

@sodabrew sodabrew merged commit f97b2e3 into php-memcached-dev:master Oct 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants