Skip to content

Fix ZTS build #1

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
Prev Previous commit
Next Next commit
Fix error code reading for libmemcached-0.49.
  • Loading branch information
andreiz authored and adoy committed May 18, 2011
commit e7884a9296113158db7e8e256fba1b3749d16b78
19 changes: 15 additions & 4 deletions php_memcached.c
Original file line number Diff line number Diff line change
Expand Up @@ -2441,15 +2441,23 @@ static int php_memc_handle_error(php_memc_t *i_obj, memcached_return status TSRM

case MEMCACHED_SOME_ERRORS:
i_obj->rescode = status;
/* Hnngghgh! */
i_obj->memc_errno = i_obj->obj->memc->cached_errno;
#if defined(LIBMEMCACHED_VERSION_HEX) && LIBMEMCACHED_VERSION_HEX >= 0x00049000
i_obj->memc_errno = memcached_last_error_errno(i_obj->obj->memc);
#else
i_obj->memc_errno = i_obj->obj->memc->cached_errno; /* Hnngghgh! */

#endif
result = 0;
break;

default:
i_obj->rescode = status;
/* Hnngghgh! */
i_obj->memc_errno = i_obj->obj->memc->cached_errno;
#if defined(LIBMEMCACHED_VERSION_HEX) && LIBMEMCACHED_VERSION_HEX >= 0x00049000
i_obj->memc_errno = memcached_last_error_errno(i_obj->obj->memc);
#else
i_obj->memc_errno = i_obj->obj->memc->cached_errno; /* Hnngghgh! */

#endif
result = -1;
break;
}
Expand Down Expand Up @@ -3383,6 +3391,9 @@ static void php_memc_register_constants(INIT_FUNC_ARGS)
REGISTER_MEMC_CLASS_CONST_LONG(OPT_NUMBER_OF_REPLICAS, MEMCACHED_BEHAVIOR_NUMBER_OF_REPLICAS);
REGISTER_MEMC_CLASS_CONST_LONG(OPT_RANDOMIZE_REPLICA_READ, MEMCACHED_BEHAVIOR_RANDOMIZE_REPLICA_READ);
#endif
#if defined(LIBMEMCACHED_VERSION_HEX) && LIBMEMCACHED_VERSION_HEX >= 0x00049000
REGISTER_MEMC_CLASS_CONST_LONG(OPT_REMOVE_FAILED_SERVERS, MEMCACHED_BEHAVIOR_REMOVE_FAILED_SERVERS);
#endif

/*
* libmemcached result codes
Expand Down