Merge lp:~tangent-org/libmemcached/1.0-build into lp:libmemcached/1.0

Proposed by Brian Aker on 2012-12-31
Status: Merged
Merged at revision: 1126
Proposed branch: lp:~tangent-org/libmemcached/1.0-build
Merge into: lp:libmemcached/1.0
Diff against target: 287 lines (+48/-50)
10 files modified
example/include.am (+1/-1)
libmemcached/common.h (+8/-1)
libmemcached/connect.cc (+3/-10)
libmemcached/connect.hpp (+0/-2)
libmemcached/get.cc (+2/-2)
libmemcached/instance.cc (+0/-5)
libmemcached/stats.cc (+2/-2)
libmemcached/string.cc (+13/-8)
libmemcached/version.cc (+15/-15)
libtest/comparison.hpp (+4/-4)
To merge this branch: bzr merge lp:~tangent-org/libmemcached/1.0-build
Reviewer Review Type Date Requested Status
Tangent Trunk 2012-12-31 Pending
Review via email: mp+141516@code.launchpad.net
To post a comment you must log in.
1126. By Tangent.Org Continuous Integration on 2012-12-31

Merge lp:~tangent-org/libmemcached/1.0-build/ Build: jenkins-Libmemcached-181

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'example/include.am'
--- example/include.am 2012-11-20 10:34:30 +0000
+++ example/include.am 2012-12-31 09:09:27 +0000
@@ -23,4 +23,4 @@
23example_memcached_light_SOURCES+= util/pidfile.cc23example_memcached_light_SOURCES+= util/pidfile.cc
2424
25example_memcached_light_LDADD+= libmemcached/libmemcachedprotocol.la25example_memcached_light_LDADD+= libmemcached/libmemcachedprotocol.la
26example_memcached_light_LDFLAGS+= @LIBEVENT_LDFLAGS@26example_memcached_light_LDADD+= @LIBEVENT_LIB@
2727
=== modified file 'libmemcached/common.h'
--- libmemcached/common.h 2012-12-16 19:51:48 +0000
+++ libmemcached/common.h 2012-12-31 09:09:27 +0000
@@ -215,7 +215,14 @@
215215
216memcached_return_t run_distribution(memcached_st *ptr);216memcached_return_t run_distribution(memcached_st *ptr);
217217
218#define memcached_server_response_increment(A) (A)->cursor_active_++218#ifdef __cplusplus
219static inline void memcached_server_response_increment(org::libmemcached::Instance* instance)
220{
221 instance->events(POLLIN);
222 instance->cursor_active_++;
223}
224#endif
225
219#define memcached_server_response_decrement(A) (A)->cursor_active_--226#define memcached_server_response_decrement(A) (A)->cursor_active_--
220#define memcached_server_response_reset(A) (A)->cursor_active_=0227#define memcached_server_response_reset(A) (A)->cursor_active_=0
221228
222229
=== modified file 'libmemcached/connect.cc'
--- libmemcached/connect.cc 2012-12-27 11:32:03 +0000
+++ libmemcached/connect.cc 2012-12-31 09:09:27 +0000
@@ -631,6 +631,9 @@
631 server->fd= INVALID_SOCKET;631 server->fd= INVALID_SOCKET;
632 continue;632 continue;
633633
634 case ECONNREFUSED:
635 // Probably not running service
636
634 default:637 default:
635 break;638 break;
636 }639 }
@@ -830,16 +833,6 @@
830 return rc;833 return rc;
831}834}
832835
833memcached_return_t memcached_connect_try(org::libmemcached::Instance* server)
834{
835 if (server and server->root and server->root->state.is_parsing)
836 {
837 return MEMCACHED_SUCCESS;
838 }
839
840 return _memcached_connect(server, false);
841}
842
843memcached_return_t memcached_connect(org::libmemcached::Instance* server)836memcached_return_t memcached_connect(org::libmemcached::Instance* server)
844{837{
845 return _memcached_connect(server, true);838 return _memcached_connect(server, true);
846839
=== modified file 'libmemcached/connect.hpp'
--- libmemcached/connect.hpp 2012-07-07 09:48:42 +0000
+++ libmemcached/connect.hpp 2012-12-31 09:09:27 +0000
@@ -37,6 +37,4 @@
3737
38#pragma once38#pragma once
3939
40memcached_return_t memcached_connect_try(org::libmemcached::Instance*);
41memcached_return_t memcached_connect(org::libmemcached::Instance*);40memcached_return_t memcached_connect(org::libmemcached::Instance*);
42
4341
=== modified file 'libmemcached/get.cc'
--- libmemcached/get.cc 2012-12-16 19:51:48 +0000
+++ libmemcached/get.cc 2012-12-31 09:09:27 +0000
@@ -315,7 +315,7 @@
315 }315 }
316 hosts_connected++;316 hosts_connected++;
317317
318 if ((memcached_io_writev(instance, vector, 4, false)) == false)318 if ((memcached_io_writev(instance, vector, 1, false)) == false)
319 {319 {
320 failures_occured_in_sending= true;320 failures_occured_in_sending= true;
321 continue;321 continue;
@@ -324,7 +324,7 @@
324 memcached_instance_response_increment(instance);324 memcached_instance_response_increment(instance);
325 WATCHPOINT_ASSERT(instance->cursor_active_ == 1);325 WATCHPOINT_ASSERT(instance->cursor_active_ == 1);
326 }326 }
327 else327
328 {328 {
329 if ((memcached_io_writev(instance, (vector + 1), 3, false)) == false)329 if ((memcached_io_writev(instance, (vector + 1), 3, false)) == false)
330 {330 {
331331
=== modified file 'libmemcached/instance.cc'
--- libmemcached/instance.cc 2012-12-27 11:32:03 +0000
+++ libmemcached/instance.cc 2012-12-31 09:09:27 +0000
@@ -160,11 +160,6 @@
160 memcached_io_init_udp_header(self, 0);160 memcached_io_init_udp_header(self, 0);
161 }161 }
162162
163 if (memc)
164 {
165 memcached_connect_try(self);
166 }
167
168 return self;163 return self;
169}164}
170165
171166
=== modified file 'libmemcached/stats.cc'
--- libmemcached/stats.cc 2012-12-24 09:47:40 +0000
+++ libmemcached/stats.cc 2012-12-31 09:09:27 +0000
@@ -232,7 +232,6 @@
232{232{
233 char buffer[SMALL_STRING_LEN];233 char buffer[SMALL_STRING_LEN];
234 int length;234 int length;
235 char *ret;
236235
237 *error= MEMCACHED_SUCCESS;236 *error= MEMCACHED_SUCCESS;
238237
@@ -336,7 +335,8 @@
336 return NULL;335 return NULL;
337 }336 }
338337
339 ret= static_cast<char *>(libmemcached_malloc(ptr, (size_t) (length + 1)));338 // User is responsible for free() memory, so use malloc()
339 char *ret= static_cast<char *>(malloc(size_t(length +1)));
340 memcpy(ret, buffer, (size_t) length);340 memcpy(ret, buffer, (size_t) length);
341 ret[length]= '\0';341 ret[length]= '\0';
342342
343343
=== modified file 'libmemcached/string.cc'
--- libmemcached/string.cc 2012-09-10 07:42:54 +0000
+++ libmemcached/string.cc 2012-12-31 09:09:27 +0000
@@ -279,17 +279,22 @@
279279
280char *memcached_string_take_value(memcached_string_st *self)280char *memcached_string_take_value(memcached_string_st *self)
281{281{
282 assert_msg(self, "Invalid memcached_string_st");282 char* value= NULL;
283 // If we fail at adding the null, we copy and move on283
284 if (memcached_success(memcached_string_append_null(self)))284 if (memcached_string_length(self))
285 {285 {
286 return memcached_string_c_copy(self);286 assert_msg(self, "Invalid memcached_string_st");
287 // If we fail at adding the null, we copy and move on
288 if (memcached_success(memcached_string_append_null(self)))
289 {
290 return memcached_string_c_copy(self);
291 }
292
293 value= self->string;
294
295 _init_string(self);
287 }296 }
288297
289 char *value= self->string;
290
291 _init_string(self);
292
293 return value;298 return value;
294}299}
295300
296301
=== modified file 'libmemcached/version.cc'
--- libmemcached/version.cc 2012-12-27 11:32:03 +0000
+++ libmemcached/version.cc 2012-12-31 09:09:27 +0000
@@ -41,7 +41,7 @@
41 return LIBMEMCACHED_VERSION_STRING;41 return LIBMEMCACHED_VERSION_STRING;
42}42}
4343
44static inline memcached_return_t memcached_version_textual(memcached_st *ptr)44static inline memcached_return_t memcached_version_textual(memcached_st *memc)
45{45{
46 libmemcached_io_vector_st vector[]=46 libmemcached_io_vector_st vector[]=
47 {47 {
@@ -50,9 +50,9 @@
5050
51 uint32_t success= 0;51 uint32_t success= 0;
52 bool errors_happened= false;52 bool errors_happened= false;
53 for (uint32_t x= 0; x < memcached_server_count(ptr); x++)53 for (uint32_t x= 0; x < memcached_server_count(memc); x++)
54 {54 {
55 org::libmemcached::Instance* instance= memcached_instance_fetch(ptr, x);55 org::libmemcached::Instance* instance= memcached_instance_fetch(memc, x);
5656
57 // Optimization, we only fetch version once.57 // Optimization, we only fetch version once.
58 if (instance->major_version != UINT8_MAX)58 if (instance->major_version != UINT8_MAX)
@@ -75,7 +75,7 @@
75 // Collect the returned items75 // Collect the returned items
76 org::libmemcached::Instance* instance;76 org::libmemcached::Instance* instance;
77 memcached_return_t readable_error;77 memcached_return_t readable_error;
78 while ((instance= memcached_io_get_readable_server(ptr, readable_error)))78 while ((instance= memcached_io_get_readable_server(memc, readable_error)))
79 {79 {
80 memcached_return_t rrc= memcached_response(instance, NULL);80 memcached_return_t rrc= memcached_response(instance, NULL);
81 if (memcached_failed(rrc))81 if (memcached_failed(rrc))
@@ -89,7 +89,7 @@
89 return errors_happened ? MEMCACHED_SOME_ERRORS : MEMCACHED_SUCCESS;89 return errors_happened ? MEMCACHED_SOME_ERRORS : MEMCACHED_SUCCESS;
90}90}
9191
92static inline memcached_return_t memcached_version_binary(memcached_st *ptr)92static inline memcached_return_t memcached_version_binary(memcached_st *memc)
93{93{
94 protocol_binary_request_version request= {};94 protocol_binary_request_version request= {};
9595
@@ -103,9 +103,9 @@
103103
104 uint32_t success= 0;104 uint32_t success= 0;
105 bool errors_happened= false;105 bool errors_happened= false;
106 for (uint32_t x= 0; x < memcached_server_count(ptr); x++) 106 for (uint32_t x= 0; x < memcached_server_count(memc); x++)
107 {107 {
108 org::libmemcached::Instance* instance= memcached_instance_fetch(ptr, x);108 org::libmemcached::Instance* instance= memcached_instance_fetch(memc, x);
109109
110 initialize_binary_request(instance, request.message.header);110 initialize_binary_request(instance, request.message.header);
111111
@@ -130,7 +130,7 @@
130 // Collect the returned items130 // Collect the returned items
131 org::libmemcached::Instance* instance;131 org::libmemcached::Instance* instance;
132 memcached_return_t readable_error;132 memcached_return_t readable_error;
133 while ((instance= memcached_io_get_readable_server(ptr, readable_error)))133 while ((instance= memcached_io_get_readable_server(memc, readable_error)))
134 {134 {
135 char buffer[32];135 char buffer[32];
136 memcached_return_t rrc= memcached_response(instance, buffer, sizeof(buffer), NULL);136 memcached_return_t rrc= memcached_response(instance, buffer, sizeof(buffer), NULL);
@@ -202,27 +202,27 @@
202 }202 }
203}203}
204204
205memcached_return_t memcached_version(memcached_st *ptr)205memcached_return_t memcached_version(memcached_st *memc)
206{206{
207 if (ptr)207 if (memc)
208 {208 {
209 memcached_return_t rc;209 memcached_return_t rc;
210 if (memcached_failed(rc= initialize_query(ptr, true)))210 if (memcached_failed(rc= initialize_query(memc, true)))
211 {211 {
212 return rc;212 return rc;
213 }213 }
214214
215 if (memcached_is_udp(ptr))215 if (memcached_is_udp(memc))
216 {216 {
217 return MEMCACHED_NOT_SUPPORTED;217 return MEMCACHED_NOT_SUPPORTED;
218 }218 }
219219
220 if (memcached_is_binary(ptr))220 if (memcached_is_binary(memc))
221 {221 {
222 return memcached_version_binary(ptr);222 return memcached_version_binary(memc);
223 }223 }
224224
225 return memcached_version_textual(ptr); 225 return memcached_version_textual(memc);
226 }226 }
227227
228 return MEMCACHED_INVALID_ARGUMENTS;228 return MEMCACHED_INVALID_ARGUMENTS;
229229
=== modified file 'libtest/comparison.hpp'
--- libtest/comparison.hpp 2012-10-22 00:48:10 +0000
+++ libtest/comparison.hpp 2012-12-31 09:09:27 +0000
@@ -39,13 +39,13 @@
39#include <typeinfo>39#include <typeinfo>
4040
41#if defined(HAVE_LIBMEMCACHED) && HAVE_LIBMEMCACHED41#if defined(HAVE_LIBMEMCACHED) && HAVE_LIBMEMCACHED
42#include <libmemcached-1.0/memcached.h>42# include <libmemcached-1.0/memcached.h>
43#include <libmemcachedutil-1.0/ostream.hpp>43# include <libmemcachedutil-1.0/ostream.hpp>
44#include <libtest/memcached.hpp>44# include <libtest/memcached.hpp>
45#endif45#endif
4646
47#if defined(HAVE_LIBGEARMAN) && HAVE_LIBGEARMAN47#if defined(HAVE_LIBGEARMAN) && HAVE_LIBGEARMAN
48#include <libgearman-1.0/ostream.hpp>48# include <libgearman-1.0/ostream.hpp>
49#endif49#endif
5050
51namespace libtest {51namespace libtest {

Subscribers

People subscribed via source and target branches

to all changes: