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
1=== modified file 'example/include.am'
2--- example/include.am 2012-11-20 10:34:30 +0000
3+++ example/include.am 2012-12-31 09:09:27 +0000
4@@ -23,4 +23,4 @@
5 example_memcached_light_SOURCES+= util/pidfile.cc
6
7 example_memcached_light_LDADD+= libmemcached/libmemcachedprotocol.la
8-example_memcached_light_LDFLAGS+= @LIBEVENT_LDFLAGS@
9+example_memcached_light_LDADD+= @LIBEVENT_LIB@
10
11=== modified file 'libmemcached/common.h'
12--- libmemcached/common.h 2012-12-16 19:51:48 +0000
13+++ libmemcached/common.h 2012-12-31 09:09:27 +0000
14@@ -215,7 +215,14 @@
15
16 memcached_return_t run_distribution(memcached_st *ptr);
17
18-#define memcached_server_response_increment(A) (A)->cursor_active_++
19+#ifdef __cplusplus
20+static inline void memcached_server_response_increment(org::libmemcached::Instance* instance)
21+{
22+ instance->events(POLLIN);
23+ instance->cursor_active_++;
24+}
25+#endif
26+
27 #define memcached_server_response_decrement(A) (A)->cursor_active_--
28 #define memcached_server_response_reset(A) (A)->cursor_active_=0
29
30
31=== modified file 'libmemcached/connect.cc'
32--- libmemcached/connect.cc 2012-12-27 11:32:03 +0000
33+++ libmemcached/connect.cc 2012-12-31 09:09:27 +0000
34@@ -631,6 +631,9 @@
35 server->fd= INVALID_SOCKET;
36 continue;
37
38+ case ECONNREFUSED:
39+ // Probably not running service
40+
41 default:
42 break;
43 }
44@@ -830,16 +833,6 @@
45 return rc;
46 }
47
48-memcached_return_t memcached_connect_try(org::libmemcached::Instance* server)
49-{
50- if (server and server->root and server->root->state.is_parsing)
51- {
52- return MEMCACHED_SUCCESS;
53- }
54-
55- return _memcached_connect(server, false);
56-}
57-
58 memcached_return_t memcached_connect(org::libmemcached::Instance* server)
59 {
60 return _memcached_connect(server, true);
61
62=== modified file 'libmemcached/connect.hpp'
63--- libmemcached/connect.hpp 2012-07-07 09:48:42 +0000
64+++ libmemcached/connect.hpp 2012-12-31 09:09:27 +0000
65@@ -37,6 +37,4 @@
66
67 #pragma once
68
69-memcached_return_t memcached_connect_try(org::libmemcached::Instance*);
70 memcached_return_t memcached_connect(org::libmemcached::Instance*);
71-
72
73=== modified file 'libmemcached/get.cc'
74--- libmemcached/get.cc 2012-12-16 19:51:48 +0000
75+++ libmemcached/get.cc 2012-12-31 09:09:27 +0000
76@@ -315,7 +315,7 @@
77 }
78 hosts_connected++;
79
80- if ((memcached_io_writev(instance, vector, 4, false)) == false)
81+ if ((memcached_io_writev(instance, vector, 1, false)) == false)
82 {
83 failures_occured_in_sending= true;
84 continue;
85@@ -324,7 +324,7 @@
86 memcached_instance_response_increment(instance);
87 WATCHPOINT_ASSERT(instance->cursor_active_ == 1);
88 }
89- else
90+
91 {
92 if ((memcached_io_writev(instance, (vector + 1), 3, false)) == false)
93 {
94
95=== modified file 'libmemcached/instance.cc'
96--- libmemcached/instance.cc 2012-12-27 11:32:03 +0000
97+++ libmemcached/instance.cc 2012-12-31 09:09:27 +0000
98@@ -160,11 +160,6 @@
99 memcached_io_init_udp_header(self, 0);
100 }
101
102- if (memc)
103- {
104- memcached_connect_try(self);
105- }
106-
107 return self;
108 }
109
110
111=== modified file 'libmemcached/stats.cc'
112--- libmemcached/stats.cc 2012-12-24 09:47:40 +0000
113+++ libmemcached/stats.cc 2012-12-31 09:09:27 +0000
114@@ -232,7 +232,6 @@
115 {
116 char buffer[SMALL_STRING_LEN];
117 int length;
118- char *ret;
119
120 *error= MEMCACHED_SUCCESS;
121
122@@ -336,7 +335,8 @@
123 return NULL;
124 }
125
126- ret= static_cast<char *>(libmemcached_malloc(ptr, (size_t) (length + 1)));
127+ // User is responsible for free() memory, so use malloc()
128+ char *ret= static_cast<char *>(malloc(size_t(length +1)));
129 memcpy(ret, buffer, (size_t) length);
130 ret[length]= '\0';
131
132
133=== modified file 'libmemcached/string.cc'
134--- libmemcached/string.cc 2012-09-10 07:42:54 +0000
135+++ libmemcached/string.cc 2012-12-31 09:09:27 +0000
136@@ -279,17 +279,22 @@
137
138 char *memcached_string_take_value(memcached_string_st *self)
139 {
140- assert_msg(self, "Invalid memcached_string_st");
141- // If we fail at adding the null, we copy and move on
142- if (memcached_success(memcached_string_append_null(self)))
143+ char* value= NULL;
144+
145+ if (memcached_string_length(self))
146 {
147- return memcached_string_c_copy(self);
148+ assert_msg(self, "Invalid memcached_string_st");
149+ // If we fail at adding the null, we copy and move on
150+ if (memcached_success(memcached_string_append_null(self)))
151+ {
152+ return memcached_string_c_copy(self);
153+ }
154+
155+ value= self->string;
156+
157+ _init_string(self);
158 }
159
160- char *value= self->string;
161-
162- _init_string(self);
163-
164 return value;
165 }
166
167
168=== modified file 'libmemcached/version.cc'
169--- libmemcached/version.cc 2012-12-27 11:32:03 +0000
170+++ libmemcached/version.cc 2012-12-31 09:09:27 +0000
171@@ -41,7 +41,7 @@
172 return LIBMEMCACHED_VERSION_STRING;
173 }
174
175-static inline memcached_return_t memcached_version_textual(memcached_st *ptr)
176+static inline memcached_return_t memcached_version_textual(memcached_st *memc)
177 {
178 libmemcached_io_vector_st vector[]=
179 {
180@@ -50,9 +50,9 @@
181
182 uint32_t success= 0;
183 bool errors_happened= false;
184- for (uint32_t x= 0; x < memcached_server_count(ptr); x++)
185+ for (uint32_t x= 0; x < memcached_server_count(memc); x++)
186 {
187- org::libmemcached::Instance* instance= memcached_instance_fetch(ptr, x);
188+ org::libmemcached::Instance* instance= memcached_instance_fetch(memc, x);
189
190 // Optimization, we only fetch version once.
191 if (instance->major_version != UINT8_MAX)
192@@ -75,7 +75,7 @@
193 // Collect the returned items
194 org::libmemcached::Instance* instance;
195 memcached_return_t readable_error;
196- while ((instance= memcached_io_get_readable_server(ptr, readable_error)))
197+ while ((instance= memcached_io_get_readable_server(memc, readable_error)))
198 {
199 memcached_return_t rrc= memcached_response(instance, NULL);
200 if (memcached_failed(rrc))
201@@ -89,7 +89,7 @@
202 return errors_happened ? MEMCACHED_SOME_ERRORS : MEMCACHED_SUCCESS;
203 }
204
205-static inline memcached_return_t memcached_version_binary(memcached_st *ptr)
206+static inline memcached_return_t memcached_version_binary(memcached_st *memc)
207 {
208 protocol_binary_request_version request= {};
209
210@@ -103,9 +103,9 @@
211
212 uint32_t success= 0;
213 bool errors_happened= false;
214- for (uint32_t x= 0; x < memcached_server_count(ptr); x++)
215+ for (uint32_t x= 0; x < memcached_server_count(memc); x++)
216 {
217- org::libmemcached::Instance* instance= memcached_instance_fetch(ptr, x);
218+ org::libmemcached::Instance* instance= memcached_instance_fetch(memc, x);
219
220 initialize_binary_request(instance, request.message.header);
221
222@@ -130,7 +130,7 @@
223 // Collect the returned items
224 org::libmemcached::Instance* instance;
225 memcached_return_t readable_error;
226- while ((instance= memcached_io_get_readable_server(ptr, readable_error)))
227+ while ((instance= memcached_io_get_readable_server(memc, readable_error)))
228 {
229 char buffer[32];
230 memcached_return_t rrc= memcached_response(instance, buffer, sizeof(buffer), NULL);
231@@ -202,27 +202,27 @@
232 }
233 }
234
235-memcached_return_t memcached_version(memcached_st *ptr)
236+memcached_return_t memcached_version(memcached_st *memc)
237 {
238- if (ptr)
239+ if (memc)
240 {
241 memcached_return_t rc;
242- if (memcached_failed(rc= initialize_query(ptr, true)))
243+ if (memcached_failed(rc= initialize_query(memc, true)))
244 {
245 return rc;
246 }
247
248- if (memcached_is_udp(ptr))
249+ if (memcached_is_udp(memc))
250 {
251 return MEMCACHED_NOT_SUPPORTED;
252 }
253
254- if (memcached_is_binary(ptr))
255+ if (memcached_is_binary(memc))
256 {
257- return memcached_version_binary(ptr);
258+ return memcached_version_binary(memc);
259 }
260
261- return memcached_version_textual(ptr);
262+ return memcached_version_textual(memc);
263 }
264
265 return MEMCACHED_INVALID_ARGUMENTS;
266
267=== modified file 'libtest/comparison.hpp'
268--- libtest/comparison.hpp 2012-10-22 00:48:10 +0000
269+++ libtest/comparison.hpp 2012-12-31 09:09:27 +0000
270@@ -39,13 +39,13 @@
271 #include <typeinfo>
272
273 #if defined(HAVE_LIBMEMCACHED) && HAVE_LIBMEMCACHED
274-#include <libmemcached-1.0/memcached.h>
275-#include <libmemcachedutil-1.0/ostream.hpp>
276-#include <libtest/memcached.hpp>
277+# include <libmemcached-1.0/memcached.h>
278+# include <libmemcachedutil-1.0/ostream.hpp>
279+# include <libtest/memcached.hpp>
280 #endif
281
282 #if defined(HAVE_LIBGEARMAN) && HAVE_LIBGEARMAN
283-#include <libgearman-1.0/ostream.hpp>
284+# include <libgearman-1.0/ostream.hpp>
285 #endif
286
287 namespace libtest {

Subscribers

People subscribed via source and target branches

to all changes: