Skip to content
Permalink
Browse files

Merge branch 'willfitch-NON_BLOCKING_IO_php7' into NON_BLOCKING_IO_php7

  • Loading branch information...
szabolcsbalogh committed Mar 11, 2016
2 parents fdbd46b + c051ca7 commit 4991c2fff22d00dc81014cc92d2da7077ef4bc86
Showing with 78 additions and 15 deletions.
  1. +55 −0 .gitignore
  2. +4 −4 php7/memcache.c
  3. +8 −0 php7/memcache_binary_protocol.c
  4. +5 −5 php7/memcache_pool.h
  5. +6 −6 php7/memcache_queue.h
@@ -0,0 +1,55 @@
# Object files
*.o
*.ko
*.obj
*.elf

# Precompiled Headers
*.gch
*.pch

# Libraries
*.lib
*.a
*.la
*.lo

# Shared objects (inc. Windows DLLs)
*.dll
*.so
*.so.*
*.dylib

# Executables
*.exe
*.out
*.app
*.i*86
*.x86_64
*.hex

# Debug files
*.dSYM/

*.fragments
Makefile*
autom4te*
aclocal*
.libs/
acinclude.m4
build/
config.guess
config.h
config.h.in
config.log
config.nice
config.status
config.sub
configure
configure.in
install-sh
libtool
ltmain.sh
missing
mkinstalldirs
run-tests.php
@@ -897,7 +897,7 @@ static int mmc_stats_parse_stat(char *start, char *end, zval *result) /* {{{ */
{
char *key;
const char *space, *colon;
long index = 0;
zend_long index = 0;

if (Z_TYPE_P(result) != IS_ARRAY) {
array_init(result);
@@ -927,12 +927,12 @@ static int mmc_stats_parse_stat(char *start, char *end, zval *result) /* {{{ */
}

efree(key);
return mmc_stats_parse_stat(colon + 1, end, element);
return mmc_stats_parse_stat(((char *) colon) + 1, end, element);
}

/* no more subkeys, add value under last subkey */
key = estrndup(start, space - start);
add_assoc_stringl_ex(result, key, space - start, space + 1, end - space);
add_assoc_stringl_ex(result, key, ((char *) space) - start, ((char *) space) + 1, end - ((char *) space));
efree(key);

return 1;
@@ -991,7 +991,7 @@ static int mmc_stats_parse_generic(char *start, char *end, zval *result) /* {{{
if (start < end) {
if ((space = php_memnstr(start, " ", 1, end)) != NULL) {
key = estrndup(start, space - start);
add_assoc_stringl_ex(result, key, space - start + 1, space + 1, end - space);
add_assoc_stringl_ex(result, key, ((char *) space) - start + 1, ((char *) space) + 1, end - ((char *) space));
efree(key);
}
else {
@@ -36,6 +36,14 @@
#include "memcache_pool.h"
#include "ext/standard/php_smart_string.h"

#ifdef htonll
#undef htonll
#endif

#ifdef ntohll
#undef ntohll
#endif

#ifndef PHP_WIN32
#if __BYTE_ORDER == __BIG_ENDIAN
# define ntohll(x) (x)
@@ -134,8 +134,8 @@ typedef struct mmc_buffer {
#define MMC_POOL_INLINE inline
#endif

MMC_POOL_INLINE void mmc_buffer_alloc(mmc_buffer_t *, unsigned int);
MMC_POOL_INLINE void mmc_buffer_free(mmc_buffer_t *);
void mmc_buffer_alloc(mmc_buffer_t *, unsigned int);
void mmc_buffer_free(mmc_buffer_t *);

/* stream handlers */
typedef struct mmc_stream mmc_stream_t;
@@ -326,7 +326,7 @@ extern mmc_hash_strategy_t mmc_consistent_hash;
#define FNV_32_INIT 0x811c9dc5

/* failure callback prototype */
typedef void (*mmc_failure_callback)(mmc_pool_t *pool, mmc_t *mmc, void *param);
typedef void (*mmc_failure_callback)(mmc_pool_t *pool, mmc_t *mmc, zval *param);

/* server pool */
struct mmc_pool {
@@ -394,8 +394,8 @@ int mmc_unpack_value(mmc_t *, mmc_request_t *, mmc_buffer_t *, const char *, uns
double timeval_to_double(struct timeval tv);
struct timeval double_to_timeval(double sec);

MMC_POOL_INLINE int mmc_prepare_key_ex(const char *, unsigned int, char *, unsigned int *);
MMC_POOL_INLINE int mmc_prepare_key(zval *, char *, unsigned int *);
int mmc_prepare_key_ex(const char *, unsigned int, char *, unsigned int *);
int mmc_prepare_key(zval *, char *, unsigned int *);

#define mmc_str_left(h, n, hlen, nlen) ((hlen) >= (nlen) ? memcmp((h), (n), (nlen)) == 0 : 0)

@@ -46,12 +46,12 @@ typedef struct mmc_queue {
#define MMC_QUEUE_INLINE inline
#endif

MMC_QUEUE_INLINE void mmc_queue_push(mmc_queue_t *, void *);
MMC_QUEUE_INLINE void *mmc_queue_pop(mmc_queue_t *);
MMC_QUEUE_INLINE int mmc_queue_contains(mmc_queue_t *, void *);
MMC_QUEUE_INLINE void mmc_queue_free(mmc_queue_t *);
MMC_QUEUE_INLINE void mmc_queue_copy(mmc_queue_t *, mmc_queue_t *);
MMC_QUEUE_INLINE void mmc_queue_remove(mmc_queue_t *, void *);
void mmc_queue_push(mmc_queue_t *, void *);
void *mmc_queue_pop(mmc_queue_t *);
int mmc_queue_contains(mmc_queue_t *, void *);
void mmc_queue_free(mmc_queue_t *);
void mmc_queue_copy(mmc_queue_t *, mmc_queue_t *);
void mmc_queue_remove(mmc_queue_t *, void *);

#endif /*MEMCACHE_QUEUE_H_*/

0 comments on commit 4991c2f

Please sign in to comment.
You can’t perform that action at this time.