com pecl/caching/memcache: stupid me. remove debug code: memcache_binary_protocol.c

From: Date: Wed, 06 Nov 2013 08:25:32 +0000
Subject: com pecl/caching/memcache: stupid me. remove debug code: memcache_binary_protocol.c
Groups: php.pecl.cvs 
Request: Send a blank email to pecl-cvs+get-19976@lists.php.net to get a copy of this message
Commit: 57ac2ee2c564745635a4892715bdeb45736a0003 Author: Pierre Joye <pierre.php@gmail.com> Wed, 6 Nov 2013 09:25:32 +0100 Parents: 890d7be4c141ac798e0cd8c5ab39ea0de42cff29 Branches: NON_BLOCKING_IO Link: http://git.php.net/?p=pecl/caching/memcache.git;a=commitdiff;h=57ac2ee2c564745635a4892715bdeb45736a0003 Log: stupid me. remove debug code Changed paths: M memcache_binary_protocol.c Diff: diff --git a/memcache_binary_protocol.c b/memcache_binary_protocol.c index fc21357..cea4558 100644 --- a/memcache_binary_protocol.c +++ b/memcache_binary_protocol.c @@ -22,7 +22,7 @@ #ifdef HAVE_CONFIG_H #include "config.h" #endif - +#define MMC_DEBUG 1 #ifdef PHP_WIN32 #include <win32/php_stdint.h> #include <winsock2.h> @@ -232,6 +232,7 @@ static int mmc_request_parse_response(mmc_t *mmc, mmc_request_t *request TSRMLS_ size_t size_header = sizeof(mmc_response_header_t); header = (mmc_response_header_t *)mmc_stream_get(request->io, sizeof(mmc_response_header_t) TSRMLS_CC); + if (header != NULL) { if (header->magic != MMC_RESPONSE_MAGIC) { return mmc_server_failure(mmc, request->io, "Malformed server response (invalid magic byte)", 0 TSRMLS_CC); @@ -714,7 +715,7 @@ static void mmc_set_sasl_auth_data(mmc_pool_t *pool, mmc_request_t *request, con { const char *key = "PLAIN"; const unsigned int key_len = 5; - int status, prevlen, valuelen; + int prevlen, valuelen; mmc_sasl_request_header *header; mmc_binary_request_t *req = (mmc_binary_request_t *)request; unsigned int flags = 0; @@ -743,7 +744,8 @@ static void mmc_set_sasl_auth_data(mmc_pool_t *pool, mmc_request_t *request, con (header->base).extras_len = 0x0; (header->base).datatype = 0x0; (header->base)._reserved = 0x0; - (header->base).length = htonl(strlen("phpuser123456") + key_len + 2); + + (header->base).length = htonl(strlen(user) + strlen(password) + key_len + 2); (header->base).reqid = htonl(0); header->base.cas = 0x0; @@ -751,6 +753,7 @@ static void mmc_set_sasl_auth_data(mmc_pool_t *pool, mmc_request_t *request, con smart_str_appendl(&(request->sendbuf.value), user, strlen(user)); smart_str_appendl(&(request->sendbuf.value), "\0", 1); smart_str_appendl(&(request->sendbuf.value), password, strlen(password)); + #if MMC_DEBUG mmc_binary_hexdump(request->sendbuf.value.c, request->sendbuf.value.len); #endif

« previous php.pecl.cvs (#19976) next »