memcached 1.2.7 → 1.3
Sign up to get free protection for your applications and to get access to all the features.
- data.tar.gz.sig +0 -0
- data/CHANGELOG +4 -0
- data/Manifest +2 -0
- data/Rakefile +3 -2
- data/ext/extconf.rb +14 -8
- data/ext/libmemcached-0.32/libmemcached/Makefile.am +4 -2
- data/ext/libmemcached-0.32/libmemcached/Makefile.in +23 -14
- data/ext/libmemcached-0.32/libmemcached/libmemcached_probes.d +2 -0
- data/ext/libmemcached-0.32/libmemcached/libmemcached_probes.h +4 -0
- data/ext/libmemcached-0.32/libmemcached/memcached.h +1 -0
- data/ext/libmemcached-0.32/libmemcached/memcached/protocol_binary.h +19 -0
- data/ext/libmemcached-0.32/libmemcached/memcached_get.c +5 -6
- data/ext/libmemcached-0.32/libmemcached/memcached_response.c +1 -0
- data/ext/libmemcached-0.32/libmemcached/memcached_stats.c +0 -17
- data/ext/libmemcached-0.32/libmemcached/memcached_touch.c +60 -0
- data/ext/libmemcached-0.32/libmemcached/memcached_touch.h +31 -0
- data/ext/libmemcached-0.32/tests/function.c +112 -0
- data/ext/rlibmemcached.i +1 -0
- data/ext/rlibmemcached_wrap.c +97 -0
- data/lib/memcached/experimental.rb +17 -4
- data/lib/memcached/memcached.rb +2 -1
- data/memcached.gemspec +6 -4
- data/test/setup.rb +4 -3
- data/test/unit/memcached_experimental_test.rb +47 -0
- metadata +29 -16
- metadata.gz.sig +0 -0
data.tar.gz.sig
ADDED
Binary file
|
data/CHANGELOG
CHANGED
@@ -1,3 +1,7 @@
|
|
1
|
+
v1.3. Improvements to BSD support; add Memcached#touch method (avsej).
|
2
|
+
|
3
|
+
v1.2.7.1 Retry SomeErrorsWereReported exception
|
4
|
+
|
1
5
|
v1.2.7. Fix prefix keys on binary (multi)gets. Remove extraneous space from CAS requests.
|
2
6
|
|
3
7
|
v1.2.6. Fix build issue on FreeBSD. Fix errno mangling on timeouts during memcached_connect().
|
data/Manifest
CHANGED
@@ -137,6 +137,8 @@ ext/libmemcached-0.32/libmemcached/memcached_storage.h
|
|
137
137
|
ext/libmemcached-0.32/libmemcached/memcached_strerror.c
|
138
138
|
ext/libmemcached-0.32/libmemcached/memcached_string.c
|
139
139
|
ext/libmemcached-0.32/libmemcached/memcached_string.h
|
140
|
+
ext/libmemcached-0.32/libmemcached/memcached_touch.c
|
141
|
+
ext/libmemcached-0.32/libmemcached/memcached_touch.h
|
140
142
|
ext/libmemcached-0.32/libmemcached/memcached_types.h
|
141
143
|
ext/libmemcached-0.32/libmemcached/memcached_util.h
|
142
144
|
ext/libmemcached-0.32/libmemcached/memcached_verbosity.c
|
data/Rakefile
CHANGED
@@ -12,6 +12,7 @@ Echoe.new("memcached") do |p|
|
|
12
12
|
"ext/lib",
|
13
13
|
"ext/share",
|
14
14
|
"ext/**/Makefile",
|
15
|
+
"ext/libmemcached-*/autom4te.cache",
|
15
16
|
"ext/libmemcached-*/clients/memcat",
|
16
17
|
"ext/libmemcached-*/clients/memcp",
|
17
18
|
"ext/libmemcached-*/clients/memdump",
|
@@ -53,11 +54,11 @@ task :exceptions do
|
|
53
54
|
end
|
54
55
|
|
55
56
|
task :test_all do
|
56
|
-
if !system("rvm use ree-1.8.7-2010.02 && rake clean && rake")
|
57
|
+
if !system("bash -c 'cd && source .bash_profile && rvm use ree-1.8.7-2010.02 && cd - && rake clean && rake'")
|
57
58
|
puts "REE test failed"
|
58
59
|
exit(1)
|
59
60
|
end
|
60
|
-
if !system("rvm use
|
61
|
+
if !system("bash -c 'cd && source .bash_profile && rvm use 1.9.2-p180 && cd - && rake clean && rake'")
|
61
62
|
puts "1.9 test failed"
|
62
63
|
exit(1)
|
63
64
|
end
|
data/ext/extconf.rb
CHANGED
@@ -4,16 +4,17 @@ require 'rbconfig'
|
|
4
4
|
HERE = File.expand_path(File.dirname(__FILE__))
|
5
5
|
BUNDLE_PATH = Dir.glob("libmemcached-*").first
|
6
6
|
|
7
|
-
SOLARIS_32 =
|
7
|
+
SOLARIS_32 = Config::CONFIG['target'] == "i386-pc-solaris2.10"
|
8
8
|
BSD = Config::CONFIG['host_os'].downcase =~ /bsd/
|
9
9
|
|
10
|
-
$CFLAGS = "#{
|
10
|
+
$CFLAGS = "#{Config::CONFIG['CFLAGS']} #{$CFLAGS}".gsub("$(cflags)", "").gsub("-fno-common", "").gsub("-Werror=declaration-after-statement", "")
|
11
11
|
$CFLAGS << " -std=gnu99" if SOLARIS_32
|
12
12
|
$CFLAGS << " -I/usr/local/include" if BSD
|
13
13
|
$EXTRA_CONF = " --disable-64bit" if SOLARIS_32
|
14
|
-
$LDFLAGS = "#{
|
14
|
+
$LDFLAGS = "#{Config::CONFIG['LDFLAGS']} #{$LDFLAGS} -L#{Config::CONFIG['libdir']}".gsub("$(ldflags)", "").gsub("-fno-common", "")
|
15
15
|
$CXXFLAGS = " -std=gnu++98"
|
16
16
|
$CPPFLAGS = $ARCH_FLAG = $DLDFLAGS = ""
|
17
|
+
$CC = "CC=#{Config::MAKEFILE_CONFIG["CC"].inspect}"
|
17
18
|
|
18
19
|
# JRuby's default configure options can't build libmemcached properly
|
19
20
|
LIBM_CFLAGS = defined?(JRUBY_VERSION) ? "-fPIC -g -O2" : $CFLAGS
|
@@ -50,7 +51,7 @@ def check_libmemcached
|
|
50
51
|
run("touch -r #{BUNDLE_PATH}/m4/visibility.m4 #{BUNDLE_PATH}/configure.ac #{BUNDLE_PATH}/m4/pandora_have_sasl.m4", "Touching aclocal.m4 in libmemcached.")
|
51
52
|
|
52
53
|
Dir.chdir(BUNDLE_PATH) do
|
53
|
-
run("env CFLAGS='-fPIC #{LIBM_CFLAGS}' LDFLAGS='-fPIC #{LIBM_LDFLAGS}' ./configure --prefix=#{HERE} --without-memcached --disable-shared --disable-utils --disable-dependency-tracking #{$EXTRA_CONF} 2>&1", "Configuring libmemcached.")
|
54
|
+
run("env CFLAGS='-fPIC #{LIBM_CFLAGS}' LDFLAGS='-fPIC #{LIBM_LDFLAGS}' ./configure --prefix=#{HERE} --without-memcached --disable-shared --disable-utils --disable-dependency-tracking #{$CC} #{$EXTRA_CONF} 2>&1", "Configuring libmemcached.")
|
54
55
|
end
|
55
56
|
|
56
57
|
Dir.chdir(BUNDLE_PATH) do
|
@@ -71,10 +72,15 @@ check_libmemcached
|
|
71
72
|
|
72
73
|
if ENV['SWIG']
|
73
74
|
puts "WARNING: Swig 2.0.2 not found. Other versions may not work." if (`swig -version`!~ /2.0.2/)
|
74
|
-
run("swig #{$defines} #{$includes} -ruby -autorename rlibmemcached.i", "Running SWIG.")
|
75
|
-
|
76
|
-
|
77
|
-
|
75
|
+
run("swig #{$defines} #{$includes} -ruby -autorename -o rlibmemcached_wrap.c.in rlibmemcached.i", "Running SWIG.")
|
76
|
+
swig_patches = {
|
77
|
+
"STR2CSTR" => "StringValuePtr", # Patching SWIG output for Ruby 1.9.
|
78
|
+
"\"swig_runtime_data\"" => "\"SwigRuntimeData\"", # Patching SWIG output for Ruby 1.9.
|
79
|
+
"#ifndef RUBY_INIT_STACK" => "#ifdef __NEVER__", # Patching SWIG output for JRuby.
|
80
|
+
}.map{|pair| "s/#{pair.join('/')}/"}.join(';')
|
81
|
+
|
82
|
+
# sed has different syntax for inplace switch in BSD and GNU version, so using intermediate file
|
83
|
+
run("sed '#{swig_patches}' rlibmemcached_wrap.c.in > rlibmemcached_wrap.c", "Apply patches to SWIG output")
|
78
84
|
end
|
79
85
|
|
80
86
|
$CFLAGS << " -Os"
|
@@ -1,8 +1,8 @@
|
|
1
1
|
EXTRA_DIST = libmemcached_probes.d memcached/README.txt libmemcached.ver \
|
2
2
|
memcached_configure.h.in
|
3
3
|
|
4
|
-
EXTRA_HEADERS =
|
5
|
-
BUILT_SOURCES=
|
4
|
+
EXTRA_HEADERS =
|
5
|
+
BUILT_SOURCES=
|
6
6
|
|
7
7
|
noinst_HEADERS = libmemcached_probes.h \
|
8
8
|
memcached_io.h \
|
@@ -15,6 +15,7 @@ pkginclude_HEADERS= memcached.h \
|
|
15
15
|
memcached_configure.h \
|
16
16
|
memcached_constants.h \
|
17
17
|
memcached_get.h \
|
18
|
+
memcached_touch.h \
|
18
19
|
memcached_result.h \
|
19
20
|
memcached_sasl.h \
|
20
21
|
memcached_server.h \
|
@@ -47,6 +48,7 @@ libmemcached_la_SOURCES = crc.c \
|
|
47
48
|
memcached_fetch.c \
|
48
49
|
memcached_flush.c \
|
49
50
|
memcached_get.c \
|
51
|
+
memcached_touch.c \
|
50
52
|
memcached_hash.c \
|
51
53
|
memcached_hosts.c \
|
52
54
|
memcached_io.c \
|
@@ -111,9 +111,9 @@ am__libmemcached_la_SOURCES_DIST = crc.c memcached.c memcached_auto.c \
|
|
111
111
|
memcached_analyze.c memcached_behavior.c memcached_connect.c \
|
112
112
|
memcached_delete.c memcached_do.c memcached_dump.c \
|
113
113
|
memcached_fetch.c memcached_flush.c memcached_get.c \
|
114
|
-
|
115
|
-
|
116
|
-
memcached_key.c memcached_quit.c memcached_parse.c \
|
114
|
+
memcached_touch.c memcached_hash.c memcached_hosts.c \
|
115
|
+
memcached_io.c memcached_purge.c memcached_flush_buffers.c \
|
116
|
+
md5.c memcached_key.c memcached_quit.c memcached_parse.c \
|
117
117
|
memcached_response.c memcached_result.c memcached_server.c \
|
118
118
|
memcached_storage.c memcached_string.c memcached_stats.c \
|
119
119
|
memcached_strerror.c memcached_verbosity.c memcached_version.c \
|
@@ -135,6 +135,7 @@ am_libmemcached_la_OBJECTS = libmemcached_la-crc.lo \
|
|
135
135
|
libmemcached_la-memcached_fetch.lo \
|
136
136
|
libmemcached_la-memcached_flush.lo \
|
137
137
|
libmemcached_la-memcached_get.lo \
|
138
|
+
libmemcached_la-memcached_touch.lo \
|
138
139
|
libmemcached_la-memcached_hash.lo \
|
139
140
|
libmemcached_la-memcached_hosts.lo \
|
140
141
|
libmemcached_la-memcached_io.lo \
|
@@ -187,10 +188,10 @@ DIST_SOURCES = $(am__libmemcached_la_SOURCES_DIST) \
|
|
187
188
|
$(libmemcachedcallbacks_la_SOURCES)
|
188
189
|
am__pkginclude_HEADERS_DIST = memcached.h memcached.hpp \
|
189
190
|
memcached_configure.h memcached_constants.h memcached_get.h \
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
memcached_pool.h
|
191
|
+
memcached_touch.h memcached_result.h memcached_sasl.h \
|
192
|
+
memcached_server.h memcached_storage.h memcached_string.h \
|
193
|
+
memcached_types.h memcached_watchpoint.h visibility.h \
|
194
|
+
memcached_util.h memcached_pool.h
|
194
195
|
HEADERS = $(noinst_HEADERS) $(pkginclude_HEADERS)
|
195
196
|
ETAGS = etags
|
196
197
|
CTAGS = ctags
|
@@ -368,10 +369,10 @@ noinst_HEADERS = libmemcached_probes.h \
|
|
368
369
|
memcached/protocol_binary.h
|
369
370
|
|
370
371
|
pkginclude_HEADERS = memcached.h memcached.hpp memcached_configure.h \
|
371
|
-
memcached_constants.h memcached_get.h
|
372
|
-
|
373
|
-
|
374
|
-
visibility.h $(am__append_1)
|
372
|
+
memcached_constants.h memcached_get.h memcached_touch.h \
|
373
|
+
memcached_result.h memcached_sasl.h memcached_server.h \
|
374
|
+
memcached_storage.h memcached_string.h memcached_types.h \
|
375
|
+
memcached_watchpoint.h visibility.h $(am__append_1)
|
375
376
|
lib_LTLIBRARIES = libmemcached.la
|
376
377
|
noinst_LTLIBRARIES = libmemcachedcallbacks.la
|
377
378
|
libmemcachedcallbacks_la_CFLAGS = ${AM_CFLAGS} ${NO_STRICT_ALIASING}
|
@@ -381,9 +382,9 @@ libmemcached_la_SOURCES = crc.c memcached.c memcached_auto.c \
|
|
381
382
|
memcached_analyze.c memcached_behavior.c memcached_connect.c \
|
382
383
|
memcached_delete.c memcached_do.c memcached_dump.c \
|
383
384
|
memcached_fetch.c memcached_flush.c memcached_get.c \
|
384
|
-
|
385
|
-
|
386
|
-
memcached_key.c memcached_quit.c memcached_parse.c \
|
385
|
+
memcached_touch.c memcached_hash.c memcached_hosts.c \
|
386
|
+
memcached_io.c memcached_purge.c memcached_flush_buffers.c \
|
387
|
+
md5.c memcached_key.c memcached_quit.c memcached_parse.c \
|
387
388
|
memcached_response.c memcached_result.c memcached_server.c \
|
388
389
|
memcached_storage.c memcached_string.c memcached_stats.c \
|
389
390
|
memcached_strerror.c memcached_verbosity.c memcached_version.c \
|
@@ -517,6 +518,7 @@ distclean-compile:
|
|
517
518
|
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmemcached_la-memcached_storage.Plo@am__quote@
|
518
519
|
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmemcached_la-memcached_strerror.Plo@am__quote@
|
519
520
|
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmemcached_la-memcached_string.Plo@am__quote@
|
521
|
+
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmemcached_la-memcached_touch.Plo@am__quote@
|
520
522
|
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmemcached_la-memcached_verbosity.Plo@am__quote@
|
521
523
|
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmemcached_la-memcached_version.Plo@am__quote@
|
522
524
|
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmemcached_la-murmur_hash.Plo@am__quote@
|
@@ -630,6 +632,13 @@ libmemcached_la-memcached_get.lo: memcached_get.c
|
|
630
632
|
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
631
633
|
@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmemcached_la_CFLAGS) $(CFLAGS) -c -o libmemcached_la-memcached_get.lo `test -f 'memcached_get.c' || echo '$(srcdir)/'`memcached_get.c
|
632
634
|
|
635
|
+
libmemcached_la-memcached_touch.lo: memcached_touch.c
|
636
|
+
@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmemcached_la_CFLAGS) $(CFLAGS) -MT libmemcached_la-memcached_touch.lo -MD -MP -MF $(DEPDIR)/libmemcached_la-memcached_touch.Tpo -c -o libmemcached_la-memcached_touch.lo `test -f 'memcached_touch.c' || echo '$(srcdir)/'`memcached_touch.c
|
637
|
+
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libmemcached_la-memcached_touch.Tpo $(DEPDIR)/libmemcached_la-memcached_touch.Plo
|
638
|
+
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='memcached_touch.c' object='libmemcached_la-memcached_touch.lo' libtool=yes @AMDEPBACKSLASH@
|
639
|
+
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
640
|
+
@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmemcached_la_CFLAGS) $(CFLAGS) -c -o libmemcached_la-memcached_touch.lo `test -f 'memcached_touch.c' || echo '$(srcdir)/'`memcached_touch.c
|
641
|
+
|
633
642
|
libmemcached_la-memcached_hash.lo: memcached_hash.c
|
634
643
|
@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmemcached_la_CFLAGS) $(CFLAGS) -MT libmemcached_la-memcached_hash.lo -MD -MP -MF $(DEPDIR)/libmemcached_la-memcached_hash.Tpo -c -o libmemcached_la-memcached_hash.lo `test -f 'memcached_hash.c' || echo '$(srcdir)/'`memcached_hash.c
|
635
644
|
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libmemcached_la-memcached_hash.Tpo $(DEPDIR)/libmemcached_la-memcached_hash.Plo
|
@@ -19,6 +19,8 @@ provider libmemcached {
|
|
19
19
|
probe memcached_replace_end();
|
20
20
|
probe memcached_get_start();
|
21
21
|
probe memcached_get_end();
|
22
|
+
probe memcached_touch_start();
|
23
|
+
probe memcached_touch_end();
|
22
24
|
probe memcached_mget_start();
|
23
25
|
probe memcached_mget_end();
|
24
26
|
probe memcached_connect_start();
|
@@ -48,6 +48,10 @@
|
|
48
48
|
#define LIBMEMCACHED_MEMCACHED_GET_END_ENABLED() (0)
|
49
49
|
#define LIBMEMCACHED_MEMCACHED_GET_START()
|
50
50
|
#define LIBMEMCACHED_MEMCACHED_GET_START_ENABLED() (0)
|
51
|
+
#define LIBMEMCACHED_MEMCACHED_TOUCH_END()
|
52
|
+
#define LIBMEMCACHED_MEMCACHED_TOUCH_END_ENABLED() (0)
|
53
|
+
#define LIBMEMCACHED_MEMCACHED_TOUCH_START()
|
54
|
+
#define LIBMEMCACHED_MEMCACHED_TOUCH_START_ENABLED() (0)
|
51
55
|
#define LIBMEMCACHED_MEMCACHED_INCREMENT_END()
|
52
56
|
#define LIBMEMCACHED_MEMCACHED_INCREMENT_END_ENABLED() (0)
|
53
57
|
#define LIBMEMCACHED_MEMCACHED_INCREMENT_START()
|
@@ -23,6 +23,7 @@
|
|
23
23
|
#include <libmemcached/memcached_constants.h>
|
24
24
|
#include <libmemcached/memcached_types.h>
|
25
25
|
#include <libmemcached/memcached_get.h>
|
26
|
+
#include <libmemcached/memcached_touch.h>
|
26
27
|
#include <libmemcached/memcached_server.h>
|
27
28
|
#include <libmemcached/memcached_string.h>
|
28
29
|
#include <libmemcached/memcached_result.h>
|
@@ -106,6 +106,7 @@ extern "C"
|
|
106
106
|
PROTOCOL_BINARY_CMD_FLUSHQ = 0x18,
|
107
107
|
PROTOCOL_BINARY_CMD_APPENDQ = 0x19,
|
108
108
|
PROTOCOL_BINARY_CMD_PREPENDQ = 0x1a,
|
109
|
+
PROTOCOL_BINARY_CMD_TOUCH = 0x1c,
|
109
110
|
PROTOCOL_BINARY_CMD_SASL_LIST_MECHS = 0x20,
|
110
111
|
PROTOCOL_BINARY_CMD_SASL_AUTH = 0x21,
|
111
112
|
PROTOCOL_BINARY_CMD_SASL_STEP = 0x22,
|
@@ -205,6 +206,24 @@ extern "C"
|
|
205
206
|
typedef protocol_binary_response_get protocol_binary_response_getk;
|
206
207
|
typedef protocol_binary_response_get protocol_binary_response_getkq;
|
207
208
|
|
209
|
+
/**
|
210
|
+
* Definition of the packet used by the touch command.
|
211
|
+
*/
|
212
|
+
typedef union {
|
213
|
+
struct {
|
214
|
+
protocol_binary_request_header header;
|
215
|
+
struct {
|
216
|
+
uint32_t expiration;
|
217
|
+
} body;
|
218
|
+
} message;
|
219
|
+
uint8_t bytes[sizeof(protocol_binary_request_header) + 4];
|
220
|
+
} protocol_binary_request_touch;
|
221
|
+
|
222
|
+
/**
|
223
|
+
* Definition of the packet returned from the touch command
|
224
|
+
*/
|
225
|
+
typedef protocol_binary_response_no_extras protocol_binary_response_touch;
|
226
|
+
|
208
227
|
/**
|
209
228
|
* Definition of the packet used by the delete command
|
210
229
|
* See section 4
|
@@ -61,6 +61,11 @@ char *memcached_get_by_key(memcached_st *ptr,
|
|
61
61
|
if (*error == MEMCACHED_END)
|
62
62
|
*error= MEMCACHED_NOTFOUND;
|
63
63
|
|
64
|
+
(void)memcached_fetch(ptr, NULL, NULL,
|
65
|
+
&dummy_length, &dummy_flags,
|
66
|
+
&dummy_error);
|
67
|
+
WATCHPOINT_ASSERT(dummy_length == 0);
|
68
|
+
|
64
69
|
if (value == NULL)
|
65
70
|
{
|
66
71
|
if (ptr->get_key_failure && *error == MEMCACHED_NOTFOUND)
|
@@ -106,14 +111,8 @@ char *memcached_get_by_key(memcached_st *ptr,
|
|
106
111
|
}
|
107
112
|
}
|
108
113
|
|
109
|
-
return NULL;
|
110
114
|
}
|
111
115
|
|
112
|
-
(void)memcached_fetch(ptr, NULL, NULL,
|
113
|
-
&dummy_length, &dummy_flags,
|
114
|
-
&dummy_error);
|
115
|
-
WATCHPOINT_ASSERT(dummy_length == 0);
|
116
|
-
|
117
116
|
return value;
|
118
117
|
}
|
119
118
|
|
@@ -412,6 +412,7 @@ static memcached_return binary_read_one_response(memcached_server_st *ptr,
|
|
412
412
|
case PROTOCOL_BINARY_CMD_APPEND:
|
413
413
|
case PROTOCOL_BINARY_CMD_PREPEND:
|
414
414
|
case PROTOCOL_BINARY_CMD_DELETE:
|
415
|
+
case PROTOCOL_BINARY_CMD_TOUCH:
|
415
416
|
{
|
416
417
|
WATCHPOINT_ASSERT(bodylen == 0);
|
417
418
|
return MEMCACHED_SUCCESS;
|
@@ -137,23 +137,6 @@ static memcached_return set_data(memcached_stat_st *memc_stat, char *key, char *
|
|
137
137
|
{
|
138
138
|
memc_stat->threads= (uint32_t) strtol(value, (char **)NULL, 10);
|
139
139
|
}
|
140
|
-
else if (!(strcmp("delete_misses", key) == 0 ||/* New stats in the 1.3 beta */
|
141
|
-
strcmp("delete_hits", key) == 0 ||/* Just swallow them for now.. */
|
142
|
-
strcmp("incr_misses", key) == 0 ||
|
143
|
-
strcmp("incr_hits", key) == 0 ||
|
144
|
-
strcmp("decr_misses", key) == 0 ||
|
145
|
-
strcmp("decr_hits", key) == 0 ||
|
146
|
-
strcmp("cas_misses", key) == 0 ||
|
147
|
-
strcmp("cas_hits", key) == 0 ||
|
148
|
-
strcmp("cas_badval", key) == 0 ||
|
149
|
-
strcmp("cmd_flush", key) == 0 ||
|
150
|
-
strcmp("accepting_conns", key) == 0 ||
|
151
|
-
strcmp("listen_disabled_num", key) == 0 ||
|
152
|
-
strcmp("conn_yields", key) == 0))
|
153
|
-
{
|
154
|
-
WATCHPOINT_STRING(key);
|
155
|
-
return MEMCACHED_UNKNOWN_STAT_KEY;
|
156
|
-
}
|
157
140
|
|
158
141
|
return MEMCACHED_SUCCESS;
|
159
142
|
}
|
@@ -0,0 +1,60 @@
|
|
1
|
+
#include "common.h"
|
2
|
+
|
3
|
+
memcached_return memcached_touch(memcached_st *ptr,
|
4
|
+
const char *key, size_t key_length,
|
5
|
+
time_t expiration)
|
6
|
+
{
|
7
|
+
return memcached_touch_by_key(ptr, key, key_length, key, key_length, expiration);
|
8
|
+
}
|
9
|
+
|
10
|
+
memcached_return memcached_touch_by_key(memcached_st *ptr,
|
11
|
+
const char *master_key, size_t master_key_length,
|
12
|
+
const char *key, size_t key_length,
|
13
|
+
time_t expiration)
|
14
|
+
{
|
15
|
+
memcached_return rc;
|
16
|
+
|
17
|
+
LIBMEMCACHED_MEMCACHED_TOUCH_START();
|
18
|
+
|
19
|
+
unlikely (ptr->flags & MEM_USE_UDP)
|
20
|
+
return MEMCACHED_NOT_SUPPORTED;
|
21
|
+
|
22
|
+
unlikely ((ptr->flags & MEM_BINARY_PROTOCOL) == 0)
|
23
|
+
return MEMCACHED_NOT_SUPPORTED;
|
24
|
+
|
25
|
+
unlikely (ptr->number_of_hosts == 0)
|
26
|
+
return MEMCACHED_NO_SERVERS;
|
27
|
+
|
28
|
+
rc= memcached_validate_key_length(key_length, 1);
|
29
|
+
unlikely (rc != MEMCACHED_SUCCESS)
|
30
|
+
return rc;
|
31
|
+
|
32
|
+
rc= memcached_validate_key_length(master_key_length, 1);
|
33
|
+
unlikely (rc != MEMCACHED_SUCCESS)
|
34
|
+
return rc;
|
35
|
+
|
36
|
+
uint32_t server_key= memcached_generate_hash(ptr, master_key, master_key_length);
|
37
|
+
memcached_server_st* instance= &ptr->hosts[server_key];
|
38
|
+
rc= memcached_connect(instance);
|
39
|
+
if (rc != MEMCACHED_SUCCESS)
|
40
|
+
return rc;
|
41
|
+
|
42
|
+
protocol_binary_request_touch request= {.bytes= {0}};
|
43
|
+
request.message.header.request.magic= PROTOCOL_BINARY_REQ;
|
44
|
+
request.message.header.request.opcode= PROTOCOL_BINARY_CMD_TOUCH;
|
45
|
+
request.message.header.request.extlen= 4;
|
46
|
+
request.message.header.request.keylen= htons((uint16_t)(key_length + ptr->prefix_key_length));
|
47
|
+
request.message.header.request.datatype= PROTOCOL_BINARY_RAW_BYTES;
|
48
|
+
request.message.header.request.bodylen= htonl((uint32_t)(key_length + ptr->prefix_key_length + request.message.header.request.extlen));
|
49
|
+
request.message.body.expiration= htonl((uint32_t) expiration);
|
50
|
+
|
51
|
+
if ((memcached_do(instance, (const char*)request.bytes, sizeof(request.bytes), 0) != MEMCACHED_SUCCESS) ||
|
52
|
+
(memcached_io_write(instance, ptr->prefix_key, ptr->prefix_key_length, 0) == -1) ||
|
53
|
+
(memcached_io_write(instance, key, key_length, 1) == -1)) {
|
54
|
+
memcached_io_reset(instance);
|
55
|
+
return MEMCACHED_WRITE_FAILURE;
|
56
|
+
}
|
57
|
+
|
58
|
+
rc = memcached_response(instance, NULL, 0, NULL);
|
59
|
+
return rc;
|
60
|
+
}
|
@@ -0,0 +1,31 @@
|
|
1
|
+
/*
|
2
|
+
* Summary: Touch function for libmemcached
|
3
|
+
*
|
4
|
+
* Copy: See Copyright for the status of this software.
|
5
|
+
*
|
6
|
+
* Author: Sergey Avseyev
|
7
|
+
*/
|
8
|
+
|
9
|
+
#ifndef __MEMCACHED_TOUCH_H__
|
10
|
+
#define __MEMCACHED_TOUCH_H__
|
11
|
+
|
12
|
+
#ifdef __cplusplus
|
13
|
+
extern "C" {
|
14
|
+
#endif
|
15
|
+
|
16
|
+
LIBMEMCACHED_API
|
17
|
+
memcached_return memcached_touch(memcached_st *ptr,
|
18
|
+
const char *key, size_t key_length,
|
19
|
+
time_t expiration);
|
20
|
+
|
21
|
+
LIBMEMCACHED_API
|
22
|
+
memcached_return memcached_touch_by_key(memcached_st *ptr,
|
23
|
+
const char *group_key, size_t group_key_length,
|
24
|
+
const char *key, size_t key_length,
|
25
|
+
time_t expiration);
|
26
|
+
|
27
|
+
#ifdef __cplusplus
|
28
|
+
}
|
29
|
+
#endif
|
30
|
+
|
31
|
+
#endif /* __MEMCACHED_TOUCH_H__ */
|
@@ -1303,6 +1303,31 @@ static test_return get_test5(memcached_st *memc)
|
|
1303
1303
|
return TEST_SUCCESS;
|
1304
1304
|
}
|
1305
1305
|
|
1306
|
+
/*
|
1307
|
+
* This test verifies that dummy NOOP response will be fetched when
|
1308
|
+
* client try to GET missing key.
|
1309
|
+
*/
|
1310
|
+
static test_return get_test6(memcached_st *memc)
|
1311
|
+
{
|
1312
|
+
const char *key= "getkey";
|
1313
|
+
const char *val= "getval";
|
1314
|
+
size_t len;
|
1315
|
+
uint32_t flags;
|
1316
|
+
char *value;
|
1317
|
+
memcached_return rc;
|
1318
|
+
|
1319
|
+
value= memcached_get(memc, key, strlen(key), &len, &flags, &rc);
|
1320
|
+
assert(len == 0);
|
1321
|
+
assert(value == 0);
|
1322
|
+
assert(rc == MEMCACHED_NOTFOUND);
|
1323
|
+
|
1324
|
+
rc= memcached_set(memc, key, strlen(key), val, strlen(val), 2, 0);
|
1325
|
+
assert(rc == MEMCACHED_SUCCESS);
|
1326
|
+
|
1327
|
+
return TEST_SUCCESS;
|
1328
|
+
}
|
1329
|
+
|
1330
|
+
|
1306
1331
|
/* Do not copy the style of this code, I just access hosts to testthis function */
|
1307
1332
|
static test_return stats_servername_test(memcached_st *memc)
|
1308
1333
|
{
|
@@ -4484,6 +4509,85 @@ static test_return jenkins_run (memcached_st *memc __attribute__((unused)))
|
|
4484
4509
|
return TEST_SUCCESS;
|
4485
4510
|
}
|
4486
4511
|
|
4512
|
+
static memcached_return check_touch_capability(memcached_st *memc)
|
4513
|
+
{
|
4514
|
+
test_return test_rc= pre_binary(memc);
|
4515
|
+
|
4516
|
+
if (test_rc != TEST_SUCCESS)
|
4517
|
+
return MEMCACHED_PROTOCOL_ERROR;
|
4518
|
+
|
4519
|
+
const char *key= "touch_capability_key";
|
4520
|
+
const char *val= "touch_capability_val";
|
4521
|
+
memcached_return rc = memcached_touch(memc, key, strlen(key), 1);
|
4522
|
+
/* it should return NOTFOUND here if TOUCH is implemented */
|
4523
|
+
return (rc == MEMCACHED_NOTFOUND) ? MEMCACHED_SUCCESS : MEMCACHED_PROTOCOL_ERROR;
|
4524
|
+
}
|
4525
|
+
|
4526
|
+
static test_return test_memcached_touch(memcached_st *memc)
|
4527
|
+
{
|
4528
|
+
const char *key= "touchkey";
|
4529
|
+
const char *val= "touchval";
|
4530
|
+
size_t len;
|
4531
|
+
uint32_t flags;
|
4532
|
+
memcached_return rc;
|
4533
|
+
char *value;
|
4534
|
+
|
4535
|
+
value= memcached_get(memc, key, strlen(key), &len, &flags, &rc);
|
4536
|
+
assert(len == 0);
|
4537
|
+
assert(value == 0);
|
4538
|
+
assert(rc == MEMCACHED_NOTFOUND);
|
4539
|
+
|
4540
|
+
rc= memcached_set(memc, key, strlen(key), val, strlen(val), 2, 0);
|
4541
|
+
assert(rc == MEMCACHED_SUCCESS);
|
4542
|
+
|
4543
|
+
sleep(1);
|
4544
|
+
|
4545
|
+
value= memcached_get(memc, key, strlen(key), &len, &flags, &rc);
|
4546
|
+
assert(len == 8);
|
4547
|
+
assert(memcmp(value, val, len) == 0);
|
4548
|
+
assert(rc == MEMCACHED_SUCCESS);
|
4549
|
+
|
4550
|
+
rc= memcached_touch(memc, key, strlen(key), 3);
|
4551
|
+
assert(rc == MEMCACHED_SUCCESS);
|
4552
|
+
|
4553
|
+
sleep(2);
|
4554
|
+
|
4555
|
+
value= memcached_get(memc, key, strlen(key), &len, &flags, &rc);
|
4556
|
+
assert(len == 8);
|
4557
|
+
assert(memcmp(value, val, len) == 0);
|
4558
|
+
assert(rc == MEMCACHED_SUCCESS);
|
4559
|
+
|
4560
|
+
sleep(2);
|
4561
|
+
|
4562
|
+
value= memcached_get(memc, key, strlen(key), &len, &flags, &rc);
|
4563
|
+
assert(len == 0);
|
4564
|
+
assert(value == 0);
|
4565
|
+
assert(rc == MEMCACHED_NOTFOUND);
|
4566
|
+
|
4567
|
+
return TEST_SUCCESS;
|
4568
|
+
}
|
4569
|
+
|
4570
|
+
static test_return test_memcached_touch_with_prefix(memcached_st *orig_memc)
|
4571
|
+
{
|
4572
|
+
const char *key= "touchkey";
|
4573
|
+
const char *val= "touchval";
|
4574
|
+
const char *prefix= "namespace:";
|
4575
|
+
memcached_return rc;
|
4576
|
+
memcached_st *memc= memcached_clone(NULL, orig_memc);
|
4577
|
+
|
4578
|
+
rc = memcached_callback_set(memc, MEMCACHED_CALLBACK_PREFIX_KEY, (void *)prefix);
|
4579
|
+
assert(rc == MEMCACHED_SUCCESS);
|
4580
|
+
|
4581
|
+
rc= memcached_set(memc, key, strlen(key), val, strlen(val), 2, 0);
|
4582
|
+
assert(rc == MEMCACHED_SUCCESS);
|
4583
|
+
|
4584
|
+
rc= memcached_touch(memc, key, strlen(key), 3);
|
4585
|
+
assert(rc == MEMCACHED_SUCCESS);
|
4586
|
+
|
4587
|
+
return TEST_SUCCESS;
|
4588
|
+
}
|
4589
|
+
|
4590
|
+
|
4487
4591
|
test_st udp_setup_server_tests[] ={
|
4488
4592
|
{"set_udp_behavior_test", 0, set_udp_behavior_test},
|
4489
4593
|
{"add_tcp_server_udp_client_test", 0, add_tcp_server_udp_client_test},
|
@@ -4536,6 +4640,7 @@ test_st tests[] ={
|
|
4536
4640
|
{"get3", 0, get_test3 },
|
4537
4641
|
{"get4", 0, get_test4 },
|
4538
4642
|
{"partial mget", 0, get_test5 },
|
4643
|
+
{"get_miss_noop", 0, get_test6 },
|
4539
4644
|
{"get_len", 1, get_len_test },
|
4540
4645
|
{"get_len2", 0, get_len_test2 },
|
4541
4646
|
{"get_len3", 0, get_len_test3 },
|
@@ -4692,6 +4797,12 @@ test_st hash_tests[] ={
|
|
4692
4797
|
{0, 0, 0}
|
4693
4798
|
};
|
4694
4799
|
|
4800
|
+
test_st touch_tests[] ={
|
4801
|
+
{"memcached_touch", 1, test_memcached_touch},
|
4802
|
+
{"memcached_touch_with_prefix", 1, test_memcached_touch_with_prefix},
|
4803
|
+
{0, 0, 0}
|
4804
|
+
};
|
4805
|
+
|
4695
4806
|
collection_st collection[] ={
|
4696
4807
|
{"hsieh_availability",0,0,hsieh_availability},
|
4697
4808
|
{"udp_setup", init_udp, 0, udp_setup_server_tests},
|
@@ -4740,6 +4851,7 @@ collection_st collection[] ={
|
|
4740
4851
|
{"consistent_ketama", pre_behavior_ketama, 0, consistent_tests},
|
4741
4852
|
{"consistent_ketama_weighted", pre_behavior_ketama_weighted, 0, consistent_weighted_tests},
|
4742
4853
|
{"test_hashes", 0, 0, hash_tests},
|
4854
|
+
{"touch", check_touch_capability, 0, touch_tests},
|
4743
4855
|
{0, 0, 0, 0}
|
4744
4856
|
};
|
4745
4857
|
|
data/ext/rlibmemcached.i
CHANGED
data/ext/rlibmemcached_wrap.c
CHANGED
@@ -12414,6 +12414,101 @@ fail:
|
|
12414
12414
|
}
|
12415
12415
|
|
12416
12416
|
|
12417
|
+
SWIGINTERN VALUE
|
12418
|
+
_wrap_memcached_touch(int argc, VALUE *argv, VALUE self) {
|
12419
|
+
memcached_st *arg1 = (memcached_st *) 0 ;
|
12420
|
+
char *arg2 = (char *) 0 ;
|
12421
|
+
size_t arg3 ;
|
12422
|
+
time_t arg4 ;
|
12423
|
+
void *argp1 = 0 ;
|
12424
|
+
int res1 = 0 ;
|
12425
|
+
unsigned long val4 ;
|
12426
|
+
int ecode4 = 0 ;
|
12427
|
+
memcached_return result;
|
12428
|
+
VALUE vresult = Qnil;
|
12429
|
+
|
12430
|
+
if ((argc < 3) || (argc > 3)) {
|
12431
|
+
rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
|
12432
|
+
}
|
12433
|
+
res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_memcached_st, 0 | 0 );
|
12434
|
+
if (!SWIG_IsOK(res1)) {
|
12435
|
+
SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "memcached_st *","memcached_touch", 1, argv[0] ));
|
12436
|
+
}
|
12437
|
+
arg1 = (memcached_st *)(argp1);
|
12438
|
+
{
|
12439
|
+
arg2 = StringValuePtr(argv[1]);
|
12440
|
+
arg3 = (size_t) RSTRING_LEN(argv[1]);
|
12441
|
+
}
|
12442
|
+
ecode4 = SWIG_AsVal_unsigned_SS_long(argv[2], &val4);
|
12443
|
+
if (!SWIG_IsOK(ecode4)) {
|
12444
|
+
SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "time_t","memcached_touch", 4, argv[2] ));
|
12445
|
+
}
|
12446
|
+
arg4 = (time_t)(val4);
|
12447
|
+
result = (memcached_return)memcached_touch(arg1,(char const *)arg2,arg3,arg4);
|
12448
|
+
vresult = SWIG_From_int((int)(result));
|
12449
|
+
return vresult;
|
12450
|
+
fail:
|
12451
|
+
return Qnil;
|
12452
|
+
}
|
12453
|
+
|
12454
|
+
|
12455
|
+
SWIGINTERN VALUE
|
12456
|
+
_wrap_memcached_touch_by_key(int argc, VALUE *argv, VALUE self) {
|
12457
|
+
memcached_st *arg1 = (memcached_st *) 0 ;
|
12458
|
+
char *arg2 = (char *) 0 ;
|
12459
|
+
size_t arg3 ;
|
12460
|
+
char *arg4 = (char *) 0 ;
|
12461
|
+
size_t arg5 ;
|
12462
|
+
time_t arg6 ;
|
12463
|
+
void *argp1 = 0 ;
|
12464
|
+
int res1 = 0 ;
|
12465
|
+
int res2 ;
|
12466
|
+
char *buf2 = 0 ;
|
12467
|
+
int alloc2 = 0 ;
|
12468
|
+
size_t val3 ;
|
12469
|
+
int ecode3 = 0 ;
|
12470
|
+
unsigned long val6 ;
|
12471
|
+
int ecode6 = 0 ;
|
12472
|
+
memcached_return result;
|
12473
|
+
VALUE vresult = Qnil;
|
12474
|
+
|
12475
|
+
if ((argc < 5) || (argc > 5)) {
|
12476
|
+
rb_raise(rb_eArgError, "wrong # of arguments(%d for 5)",argc); SWIG_fail;
|
12477
|
+
}
|
12478
|
+
res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_memcached_st, 0 | 0 );
|
12479
|
+
if (!SWIG_IsOK(res1)) {
|
12480
|
+
SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "memcached_st *","memcached_touch_by_key", 1, argv[0] ));
|
12481
|
+
}
|
12482
|
+
arg1 = (memcached_st *)(argp1);
|
12483
|
+
res2 = SWIG_AsCharPtrAndSize(argv[1], &buf2, NULL, &alloc2);
|
12484
|
+
if (!SWIG_IsOK(res2)) {
|
12485
|
+
SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","memcached_touch_by_key", 2, argv[1] ));
|
12486
|
+
}
|
12487
|
+
arg2 = (char *)(buf2);
|
12488
|
+
ecode3 = SWIG_AsVal_size_t(argv[2], &val3);
|
12489
|
+
if (!SWIG_IsOK(ecode3)) {
|
12490
|
+
SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "size_t","memcached_touch_by_key", 3, argv[2] ));
|
12491
|
+
}
|
12492
|
+
arg3 = (size_t)(val3);
|
12493
|
+
{
|
12494
|
+
arg4 = StringValuePtr(argv[3]);
|
12495
|
+
arg5 = (size_t) RSTRING_LEN(argv[3]);
|
12496
|
+
}
|
12497
|
+
ecode6 = SWIG_AsVal_unsigned_SS_long(argv[4], &val6);
|
12498
|
+
if (!SWIG_IsOK(ecode6)) {
|
12499
|
+
SWIG_exception_fail(SWIG_ArgError(ecode6), Ruby_Format_TypeError( "", "time_t","memcached_touch_by_key", 6, argv[4] ));
|
12500
|
+
}
|
12501
|
+
arg6 = (time_t)(val6);
|
12502
|
+
result = (memcached_return)memcached_touch_by_key(arg1,(char const *)arg2,arg3,(char const *)arg4,arg5,arg6);
|
12503
|
+
vresult = SWIG_From_int((int)(result));
|
12504
|
+
if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
|
12505
|
+
return vresult;
|
12506
|
+
fail:
|
12507
|
+
if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
|
12508
|
+
return Qnil;
|
12509
|
+
}
|
12510
|
+
|
12511
|
+
|
12417
12512
|
SWIGINTERN VALUE
|
12418
12513
|
_wrap_rb_str_new_by_ref(int argc, VALUE *argv, VALUE self) {
|
12419
12514
|
char *arg1 = (char *) 0 ;
|
@@ -13621,6 +13716,8 @@ SWIGEXPORT void Init_rlibmemcached(void) {
|
|
13621
13716
|
rb_define_module_function(mRlibmemcached, "memcached_destroy_sasl_auth_data", _wrap_memcached_destroy_sasl_auth_data, -1);
|
13622
13717
|
rb_define_module_function(mRlibmemcached, "memcached_get_sasl_callbacks", _wrap_memcached_get_sasl_callbacks, -1);
|
13623
13718
|
rb_define_module_function(mRlibmemcached, "memcached_sasl_authenticate_connection", _wrap_memcached_sasl_authenticate_connection, -1);
|
13719
|
+
rb_define_module_function(mRlibmemcached, "memcached_touch", _wrap_memcached_touch, -1);
|
13720
|
+
rb_define_module_function(mRlibmemcached, "memcached_touch_by_key", _wrap_memcached_touch_by_key, -1);
|
13624
13721
|
rb_define_module_function(mRlibmemcached, "rb_str_new_by_ref", _wrap_rb_str_new_by_ref, -1);
|
13625
13722
|
rb_define_module_function(mRlibmemcached, "memcached_get_rvalue", _wrap_memcached_get_rvalue, -1);
|
13626
13723
|
rb_define_module_function(mRlibmemcached, "memcached_get_len_rvalue", _wrap_memcached_get_len_rvalue, -1);
|
@@ -1,12 +1,25 @@
|
|
1
1
|
class Memcached
|
2
2
|
module Experimental
|
3
|
-
|
3
|
+
|
4
|
+
# TOUCH is used to set a new expiration time for an existing item
|
5
|
+
def touch(key, ttl=@default_ttl)
|
6
|
+
check_return_code(
|
7
|
+
Lib.memcached_touch(@struct, key, ttl),
|
8
|
+
key
|
9
|
+
)
|
10
|
+
rescue => e
|
11
|
+
tries ||= 0
|
12
|
+
raise unless tries < options[:exception_retry_limit] && should_retry(e)
|
13
|
+
tries += 1
|
14
|
+
retry
|
15
|
+
end
|
16
|
+
|
4
17
|
def get_len(bytes, keys)
|
5
18
|
if keys.is_a? ::Array
|
6
19
|
# Multi get
|
7
20
|
ret = Lib.memcached_mget_len(@struct, keys, bytes);
|
8
21
|
check_return_code(ret, keys)
|
9
|
-
|
22
|
+
|
10
23
|
hash = {}
|
11
24
|
keys.each do
|
12
25
|
value, key, flags, ret = Lib.memcached_fetch_rvalue(@struct)
|
@@ -30,6 +43,6 @@ class Memcached
|
|
30
43
|
tries += 1
|
31
44
|
retry
|
32
45
|
end
|
33
|
-
|
46
|
+
|
34
47
|
end
|
35
|
-
end
|
48
|
+
end
|
data/lib/memcached/memcached.rb
CHANGED
data/memcached.gemspec
CHANGED
@@ -2,21 +2,23 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = %q{memcached}
|
5
|
-
s.version = "1.
|
5
|
+
s.version = "1.3"
|
6
6
|
|
7
7
|
s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
|
8
8
|
s.authors = ["Evan Weaver"]
|
9
|
-
s.
|
9
|
+
s.cert_chain = ["/Users/eweaver/p/configuration/gem_certificates/evan_weaver-original-public_cert.pem"]
|
10
|
+
s.date = %q{2011-08-04}
|
10
11
|
s.description = %q{An interface to the libmemcached C client.}
|
11
12
|
s.email = %q{}
|
12
13
|
s.extensions = ["ext/extconf.rb"]
|
13
14
|
s.extra_rdoc_files = ["BENCHMARKS", "CHANGELOG", "LICENSE", "README", "TODO", "ext/libmemcached-0.32/README", "ext/libmemcached-0.32/TODO", "ext/libmemcached-0.32/libmemcached/memcached/README.txt", "lib/memcached.rb", "lib/memcached/behaviors.rb", "lib/memcached/exceptions.rb", "lib/memcached/experimental.rb", "lib/memcached/memcached.rb", "lib/memcached/rails.rb"]
|
14
|
-
s.files = ["BENCHMARKS", "CHANGELOG", "LICENSE", "Manifest", "README", "Rakefile", "TODO", "ext/extconf-make.rb", "ext/extconf.rb", "ext/libmemcached-0.32/AUTHORS", "ext/libmemcached-0.32/COPYING", "ext/libmemcached-0.32/ChangeLog", "ext/libmemcached-0.32/INSTALL", "ext/libmemcached-0.32/Makefile.am", "ext/libmemcached-0.32/Makefile.in", "ext/libmemcached-0.32/NEWS", "ext/libmemcached-0.32/README", "ext/libmemcached-0.32/THANKS", "ext/libmemcached-0.32/TODO", "ext/libmemcached-0.32/aclocal.m4", "ext/libmemcached-0.32/clients/Makefile.am", "ext/libmemcached-0.32/clients/Makefile.in", "ext/libmemcached-0.32/clients/client_options.h", "ext/libmemcached-0.32/clients/execute.c", "ext/libmemcached-0.32/clients/execute.h", "ext/libmemcached-0.32/clients/generator.c", "ext/libmemcached-0.32/clients/generator.h", "ext/libmemcached-0.32/clients/memcat.c", "ext/libmemcached-0.32/clients/memcp.c", "ext/libmemcached-0.32/clients/memdump.c", "ext/libmemcached-0.32/clients/memerror.c", "ext/libmemcached-0.32/clients/memflush.c", "ext/libmemcached-0.32/clients/memrm.c", "ext/libmemcached-0.32/clients/memslap.c", "ext/libmemcached-0.32/clients/memstat.c", "ext/libmemcached-0.32/clients/utilities.c", "ext/libmemcached-0.32/clients/utilities.h", "ext/libmemcached-0.32/config.h.in", "ext/libmemcached-0.32/config/compile", "ext/libmemcached-0.32/config/config.guess", "ext/libmemcached-0.32/config/config.rpath", "ext/libmemcached-0.32/config/config.sub", "ext/libmemcached-0.32/config/depcomp", "ext/libmemcached-0.32/config/install-sh", "ext/libmemcached-0.32/config/ltmain.sh", "ext/libmemcached-0.32/config/missing", "ext/libmemcached-0.32/configure", "ext/libmemcached-0.32/configure.ac", "ext/libmemcached-0.32/docs/Makefile.am", "ext/libmemcached-0.32/docs/Makefile.in", "ext/libmemcached-0.32/docs/libmemcached.pod", "ext/libmemcached-0.32/docs/libmemcached_examples.pod", "ext/libmemcached-0.32/docs/libmemcachedutil.pod", "ext/libmemcached-0.32/docs/memcached_analyze.pod", "ext/libmemcached-0.32/docs/memcached_auto.pod", "ext/libmemcached-0.32/docs/memcached_behavior.pod", "ext/libmemcached-0.32/docs/memcached_callback.pod", "ext/libmemcached-0.32/docs/memcached_create.pod", "ext/libmemcached-0.32/docs/memcached_delete.pod", "ext/libmemcached-0.32/docs/memcached_dump.pod", "ext/libmemcached-0.32/docs/memcached_flush.pod", "ext/libmemcached-0.32/docs/memcached_flush_buffers.pod", "ext/libmemcached-0.32/docs/memcached_generate_hash_value.pod", "ext/libmemcached-0.32/docs/memcached_get.pod", "ext/libmemcached-0.32/docs/memcached_memory_allocators.pod", "ext/libmemcached-0.32/docs/memcached_pool.pod", "ext/libmemcached-0.32/docs/memcached_quit.pod", "ext/libmemcached-0.32/docs/memcached_sasl.pod", "ext/libmemcached-0.32/docs/memcached_server_st.pod", "ext/libmemcached-0.32/docs/memcached_servers.pod", "ext/libmemcached-0.32/docs/memcached_set.pod", "ext/libmemcached-0.32/docs/memcached_stats.pod", "ext/libmemcached-0.32/docs/memcached_strerror.pod", "ext/libmemcached-0.32/docs/memcached_user_data.pod", "ext/libmemcached-0.32/docs/memcached_verbosity.pod", "ext/libmemcached-0.32/docs/memcached_version.pod", "ext/libmemcached-0.32/docs/memcat.pod", "ext/libmemcached-0.32/docs/memcp.pod", "ext/libmemcached-0.32/docs/memdump.pod", "ext/libmemcached-0.32/docs/memerror.pod", "ext/libmemcached-0.32/docs/memflush.pod", "ext/libmemcached-0.32/docs/memrm.pod", "ext/libmemcached-0.32/docs/memslap.pod", "ext/libmemcached-0.32/docs/memstat.pod", "ext/libmemcached-0.32/libmemcached/Makefile.am", "ext/libmemcached-0.32/libmemcached/Makefile.in", "ext/libmemcached-0.32/libmemcached/byteorder.c", "ext/libmemcached-0.32/libmemcached/common.h", "ext/libmemcached-0.32/libmemcached/crc.c", "ext/libmemcached-0.32/libmemcached/hsieh_hash.c", "ext/libmemcached-0.32/libmemcached/jenkins_hash.c", "ext/libmemcached-0.32/libmemcached/libmemcached.ver", "ext/libmemcached-0.32/libmemcached/libmemcached_probes.d", "ext/libmemcached-0.32/libmemcached/libmemcached_probes.h", "ext/libmemcached-0.32/libmemcached/md5.c", "ext/libmemcached-0.32/libmemcached/memcached.c", "ext/libmemcached-0.32/libmemcached/memcached.h", "ext/libmemcached-0.32/libmemcached/memcached.hpp", "ext/libmemcached-0.32/libmemcached/memcached/README.txt", "ext/libmemcached-0.32/libmemcached/memcached/protocol_binary.h", "ext/libmemcached-0.32/libmemcached/memcached_allocators.c", "ext/libmemcached-0.32/libmemcached/memcached_analyze.c", "ext/libmemcached-0.32/libmemcached/memcached_auto.c", "ext/libmemcached-0.32/libmemcached/memcached_behavior.c", "ext/libmemcached-0.32/libmemcached/memcached_callback.c", "ext/libmemcached-0.32/libmemcached/memcached_configure.h.in", "ext/libmemcached-0.32/libmemcached/memcached_connect.c", "ext/libmemcached-0.32/libmemcached/memcached_constants.h", "ext/libmemcached-0.32/libmemcached/memcached_delete.c", "ext/libmemcached-0.32/libmemcached/memcached_do.c", "ext/libmemcached-0.32/libmemcached/memcached_dump.c", "ext/libmemcached-0.32/libmemcached/memcached_fetch.c", "ext/libmemcached-0.32/libmemcached/memcached_flush.c", "ext/libmemcached-0.32/libmemcached/memcached_flush_buffers.c", "ext/libmemcached-0.32/libmemcached/memcached_get.c", "ext/libmemcached-0.32/libmemcached/memcached_get.h", "ext/libmemcached-0.32/libmemcached/memcached_hash.c", "ext/libmemcached-0.32/libmemcached/memcached_hosts.c", "ext/libmemcached-0.32/libmemcached/memcached_internal.h", "ext/libmemcached-0.32/libmemcached/memcached_io.c", "ext/libmemcached-0.32/libmemcached/memcached_io.h", "ext/libmemcached-0.32/libmemcached/memcached_key.c", "ext/libmemcached-0.32/libmemcached/memcached_parse.c", "ext/libmemcached-0.32/libmemcached/memcached_pool.h", "ext/libmemcached-0.32/libmemcached/memcached_purge.c", "ext/libmemcached-0.32/libmemcached/memcached_quit.c", "ext/libmemcached-0.32/libmemcached/memcached_response.c", "ext/libmemcached-0.32/libmemcached/memcached_result.c", "ext/libmemcached-0.32/libmemcached/memcached_result.h", "ext/libmemcached-0.32/libmemcached/memcached_sasl.c", "ext/libmemcached-0.32/libmemcached/memcached_sasl.h", "ext/libmemcached-0.32/libmemcached/memcached_server.c", "ext/libmemcached-0.32/libmemcached/memcached_server.h", "ext/libmemcached-0.32/libmemcached/memcached_stats.c", "ext/libmemcached-0.32/libmemcached/memcached_storage.c", "ext/libmemcached-0.32/libmemcached/memcached_storage.h", "ext/libmemcached-0.32/libmemcached/memcached_strerror.c", "ext/libmemcached-0.32/libmemcached/memcached_string.c", "ext/libmemcached-0.32/libmemcached/memcached_string.h", "ext/libmemcached-0.32/libmemcached/memcached_types.h", "ext/libmemcached-0.32/libmemcached/memcached_util.h", "ext/libmemcached-0.32/libmemcached/memcached_verbosity.c", "ext/libmemcached-0.32/libmemcached/memcached_version.c", "ext/libmemcached-0.32/libmemcached/memcached_watchpoint.h", "ext/libmemcached-0.32/libmemcached/murmur_hash.c", "ext/libmemcached-0.32/libmemcached/visibility.h", "ext/libmemcached-0.32/libmemcachedutil/Makefile.am", "ext/libmemcached-0.32/libmemcachedutil/Makefile.in", "ext/libmemcached-0.32/libmemcachedutil/libmemcachedutil.ver", "ext/libmemcached-0.32/libmemcachedutil/memcached_pool.c", "ext/libmemcached-0.32/m4/ac_cxx_compile_stdcxx_0x.m4", "ext/libmemcached-0.32/m4/ac_cxx_header_stdcxx_98.m4", "ext/libmemcached-0.32/m4/acx_pthread.m4", "ext/libmemcached-0.32/m4/byteorder.m4", "ext/libmemcached-0.32/m4/deprecated.m4", "ext/libmemcached-0.32/m4/enable_utillib.m4", "ext/libmemcached-0.32/m4/extensions.m4", "ext/libmemcached-0.32/m4/hsieh.m4", "ext/libmemcached-0.32/m4/lib-prefix.m4", "ext/libmemcached-0.32/m4/libtool.m4", "ext/libmemcached-0.32/m4/ltoptions.m4", "ext/libmemcached-0.32/m4/ltsugar.m4", "ext/libmemcached-0.32/m4/ltversion.m4", "ext/libmemcached-0.32/m4/lt~obsolete.m4", "ext/libmemcached-0.32/m4/memcached.m4", "ext/libmemcached-0.32/m4/pandora_64bit.m4", "ext/libmemcached-0.32/m4/pandora_canonical.m4", "ext/libmemcached-0.32/m4/pandora_check_compiler_version.m4", "ext/libmemcached-0.32/m4/pandora_check_cxx_standard.m4", "ext/libmemcached-0.32/m4/pandora_enable_dtrace.m4", "ext/libmemcached-0.32/m4/pandora_ensure_gcc_version.m4", "ext/libmemcached-0.32/m4/pandora_have_better_malloc.m4", "ext/libmemcached-0.32/m4/pandora_have_sasl.m4", "ext/libmemcached-0.32/m4/pandora_header_assert.m4", "ext/libmemcached-0.32/m4/pandora_libtool.m4", "ext/libmemcached-0.32/m4/pandora_optimize.m4", "ext/libmemcached-0.32/m4/pandora_shared_ptr.m4", "ext/libmemcached-0.32/m4/pandora_vc_build.m4", "ext/libmemcached-0.32/m4/pandora_warnings.m4", "ext/libmemcached-0.32/m4/pod2man.m4", "ext/libmemcached-0.32/m4/protocol_binary.m4", "ext/libmemcached-0.32/m4/setsockopt.m4", "ext/libmemcached-0.32/m4/visibility.m4", "ext/libmemcached-0.32/support/Makefile.am", "ext/libmemcached-0.32/support/Makefile.in", "ext/libmemcached-0.32/support/libmemcached-fc.spec.in", "ext/libmemcached-0.32/support/libmemcached.pc.in", "ext/libmemcached-0.32/support/libmemcached.spec", "ext/libmemcached-0.32/support/libmemcached.spec.in", "ext/libmemcached-0.32/support/set_benchmark.sh", "ext/libmemcached-0.32/tests/Makefile.am", "ext/libmemcached-0.32/tests/Makefile.in", "ext/libmemcached-0.32/tests/atomsmasher.c", "ext/libmemcached-0.32/tests/function.c", "ext/libmemcached-0.32/tests/ketama_test_cases.h", "ext/libmemcached-0.32/tests/output.cmp", "ext/libmemcached-0.32/tests/output.res", "ext/libmemcached-0.32/tests/output2.res", "ext/libmemcached-0.32/tests/plus.cpp", "ext/libmemcached-0.32/tests/r/memcat.res", "ext/libmemcached-0.32/tests/r/memcp.res", "ext/libmemcached-0.32/tests/r/memrm.res", "ext/libmemcached-0.32/tests/r/memslap.res", "ext/libmemcached-0.32/tests/r/memstat.res", "ext/libmemcached-0.32/tests/server.c", "ext/libmemcached-0.32/tests/server.h", "ext/libmemcached-0.32/tests/start.c", "ext/libmemcached-0.32/tests/t/memcat.test", "ext/libmemcached-0.32/tests/t/memcp.test", "ext/libmemcached-0.32/tests/t/memrm.test", "ext/libmemcached-0.32/tests/t/memslap.test", "ext/libmemcached-0.32/tests/t/memstat.test", "ext/libmemcached-0.32/tests/test.c", "ext/libmemcached-0.32/tests/test.h", "ext/libmemcached-0.32/tests/udp.c", "ext/rlibmemcached.i", "ext/rlibmemcached_wrap.c", "lib/memcached.rb", "lib/memcached/auth.rb", "lib/memcached/behaviors.rb", "lib/memcached/exceptions.rb", "lib/memcached/experimental.rb", "lib/memcached/memcached.rb", "lib/memcached/rails.rb", "test/profile/benchmark.rb", "test/profile/c_profiler.rb", "test/profile/exercise.rb", "test/profile/rb_profiler.rb", "test/profile/valgrind.rb", "test/setup.rb", "test/teardown.rb", "test/test_helper.rb", "test/unit/binding_test.rb", "test/unit/memcached_experimental_test.rb", "test/unit/memcached_test.rb", "test/unit/rails_test.rb", "memcached.gemspec"]
|
15
|
+
s.files = ["BENCHMARKS", "CHANGELOG", "LICENSE", "Manifest", "README", "Rakefile", "TODO", "ext/extconf-make.rb", "ext/extconf.rb", "ext/libmemcached-0.32/AUTHORS", "ext/libmemcached-0.32/COPYING", "ext/libmemcached-0.32/ChangeLog", "ext/libmemcached-0.32/INSTALL", "ext/libmemcached-0.32/Makefile.am", "ext/libmemcached-0.32/Makefile.in", "ext/libmemcached-0.32/NEWS", "ext/libmemcached-0.32/README", "ext/libmemcached-0.32/THANKS", "ext/libmemcached-0.32/TODO", "ext/libmemcached-0.32/aclocal.m4", "ext/libmemcached-0.32/clients/Makefile.am", "ext/libmemcached-0.32/clients/Makefile.in", "ext/libmemcached-0.32/clients/client_options.h", "ext/libmemcached-0.32/clients/execute.c", "ext/libmemcached-0.32/clients/execute.h", "ext/libmemcached-0.32/clients/generator.c", "ext/libmemcached-0.32/clients/generator.h", "ext/libmemcached-0.32/clients/memcat.c", "ext/libmemcached-0.32/clients/memcp.c", "ext/libmemcached-0.32/clients/memdump.c", "ext/libmemcached-0.32/clients/memerror.c", "ext/libmemcached-0.32/clients/memflush.c", "ext/libmemcached-0.32/clients/memrm.c", "ext/libmemcached-0.32/clients/memslap.c", "ext/libmemcached-0.32/clients/memstat.c", "ext/libmemcached-0.32/clients/utilities.c", "ext/libmemcached-0.32/clients/utilities.h", "ext/libmemcached-0.32/config.h.in", "ext/libmemcached-0.32/config/compile", "ext/libmemcached-0.32/config/config.guess", "ext/libmemcached-0.32/config/config.rpath", "ext/libmemcached-0.32/config/config.sub", "ext/libmemcached-0.32/config/depcomp", "ext/libmemcached-0.32/config/install-sh", "ext/libmemcached-0.32/config/ltmain.sh", "ext/libmemcached-0.32/config/missing", "ext/libmemcached-0.32/configure", "ext/libmemcached-0.32/configure.ac", "ext/libmemcached-0.32/docs/Makefile.am", "ext/libmemcached-0.32/docs/Makefile.in", "ext/libmemcached-0.32/docs/libmemcached.pod", "ext/libmemcached-0.32/docs/libmemcached_examples.pod", "ext/libmemcached-0.32/docs/libmemcachedutil.pod", "ext/libmemcached-0.32/docs/memcached_analyze.pod", "ext/libmemcached-0.32/docs/memcached_auto.pod", "ext/libmemcached-0.32/docs/memcached_behavior.pod", "ext/libmemcached-0.32/docs/memcached_callback.pod", "ext/libmemcached-0.32/docs/memcached_create.pod", "ext/libmemcached-0.32/docs/memcached_delete.pod", "ext/libmemcached-0.32/docs/memcached_dump.pod", "ext/libmemcached-0.32/docs/memcached_flush.pod", "ext/libmemcached-0.32/docs/memcached_flush_buffers.pod", "ext/libmemcached-0.32/docs/memcached_generate_hash_value.pod", "ext/libmemcached-0.32/docs/memcached_get.pod", "ext/libmemcached-0.32/docs/memcached_memory_allocators.pod", "ext/libmemcached-0.32/docs/memcached_pool.pod", "ext/libmemcached-0.32/docs/memcached_quit.pod", "ext/libmemcached-0.32/docs/memcached_sasl.pod", "ext/libmemcached-0.32/docs/memcached_server_st.pod", "ext/libmemcached-0.32/docs/memcached_servers.pod", "ext/libmemcached-0.32/docs/memcached_set.pod", "ext/libmemcached-0.32/docs/memcached_stats.pod", "ext/libmemcached-0.32/docs/memcached_strerror.pod", "ext/libmemcached-0.32/docs/memcached_user_data.pod", "ext/libmemcached-0.32/docs/memcached_verbosity.pod", "ext/libmemcached-0.32/docs/memcached_version.pod", "ext/libmemcached-0.32/docs/memcat.pod", "ext/libmemcached-0.32/docs/memcp.pod", "ext/libmemcached-0.32/docs/memdump.pod", "ext/libmemcached-0.32/docs/memerror.pod", "ext/libmemcached-0.32/docs/memflush.pod", "ext/libmemcached-0.32/docs/memrm.pod", "ext/libmemcached-0.32/docs/memslap.pod", "ext/libmemcached-0.32/docs/memstat.pod", "ext/libmemcached-0.32/libmemcached/Makefile.am", "ext/libmemcached-0.32/libmemcached/Makefile.in", "ext/libmemcached-0.32/libmemcached/byteorder.c", "ext/libmemcached-0.32/libmemcached/common.h", "ext/libmemcached-0.32/libmemcached/crc.c", "ext/libmemcached-0.32/libmemcached/hsieh_hash.c", "ext/libmemcached-0.32/libmemcached/jenkins_hash.c", "ext/libmemcached-0.32/libmemcached/libmemcached.ver", "ext/libmemcached-0.32/libmemcached/libmemcached_probes.d", "ext/libmemcached-0.32/libmemcached/libmemcached_probes.h", "ext/libmemcached-0.32/libmemcached/md5.c", "ext/libmemcached-0.32/libmemcached/memcached.c", "ext/libmemcached-0.32/libmemcached/memcached.h", "ext/libmemcached-0.32/libmemcached/memcached.hpp", "ext/libmemcached-0.32/libmemcached/memcached/README.txt", "ext/libmemcached-0.32/libmemcached/memcached/protocol_binary.h", "ext/libmemcached-0.32/libmemcached/memcached_allocators.c", "ext/libmemcached-0.32/libmemcached/memcached_analyze.c", "ext/libmemcached-0.32/libmemcached/memcached_auto.c", "ext/libmemcached-0.32/libmemcached/memcached_behavior.c", "ext/libmemcached-0.32/libmemcached/memcached_callback.c", "ext/libmemcached-0.32/libmemcached/memcached_configure.h.in", "ext/libmemcached-0.32/libmemcached/memcached_connect.c", "ext/libmemcached-0.32/libmemcached/memcached_constants.h", "ext/libmemcached-0.32/libmemcached/memcached_delete.c", "ext/libmemcached-0.32/libmemcached/memcached_do.c", "ext/libmemcached-0.32/libmemcached/memcached_dump.c", "ext/libmemcached-0.32/libmemcached/memcached_fetch.c", "ext/libmemcached-0.32/libmemcached/memcached_flush.c", "ext/libmemcached-0.32/libmemcached/memcached_flush_buffers.c", "ext/libmemcached-0.32/libmemcached/memcached_get.c", "ext/libmemcached-0.32/libmemcached/memcached_get.h", "ext/libmemcached-0.32/libmemcached/memcached_hash.c", "ext/libmemcached-0.32/libmemcached/memcached_hosts.c", "ext/libmemcached-0.32/libmemcached/memcached_internal.h", "ext/libmemcached-0.32/libmemcached/memcached_io.c", "ext/libmemcached-0.32/libmemcached/memcached_io.h", "ext/libmemcached-0.32/libmemcached/memcached_key.c", "ext/libmemcached-0.32/libmemcached/memcached_parse.c", "ext/libmemcached-0.32/libmemcached/memcached_pool.h", "ext/libmemcached-0.32/libmemcached/memcached_purge.c", "ext/libmemcached-0.32/libmemcached/memcached_quit.c", "ext/libmemcached-0.32/libmemcached/memcached_response.c", "ext/libmemcached-0.32/libmemcached/memcached_result.c", "ext/libmemcached-0.32/libmemcached/memcached_result.h", "ext/libmemcached-0.32/libmemcached/memcached_sasl.c", "ext/libmemcached-0.32/libmemcached/memcached_sasl.h", "ext/libmemcached-0.32/libmemcached/memcached_server.c", "ext/libmemcached-0.32/libmemcached/memcached_server.h", "ext/libmemcached-0.32/libmemcached/memcached_stats.c", "ext/libmemcached-0.32/libmemcached/memcached_storage.c", "ext/libmemcached-0.32/libmemcached/memcached_storage.h", "ext/libmemcached-0.32/libmemcached/memcached_strerror.c", "ext/libmemcached-0.32/libmemcached/memcached_string.c", "ext/libmemcached-0.32/libmemcached/memcached_string.h", "ext/libmemcached-0.32/libmemcached/memcached_touch.c", "ext/libmemcached-0.32/libmemcached/memcached_touch.h", "ext/libmemcached-0.32/libmemcached/memcached_types.h", "ext/libmemcached-0.32/libmemcached/memcached_util.h", "ext/libmemcached-0.32/libmemcached/memcached_verbosity.c", "ext/libmemcached-0.32/libmemcached/memcached_version.c", "ext/libmemcached-0.32/libmemcached/memcached_watchpoint.h", "ext/libmemcached-0.32/libmemcached/murmur_hash.c", "ext/libmemcached-0.32/libmemcached/visibility.h", "ext/libmemcached-0.32/libmemcachedutil/Makefile.am", "ext/libmemcached-0.32/libmemcachedutil/Makefile.in", "ext/libmemcached-0.32/libmemcachedutil/libmemcachedutil.ver", "ext/libmemcached-0.32/libmemcachedutil/memcached_pool.c", "ext/libmemcached-0.32/m4/ac_cxx_compile_stdcxx_0x.m4", "ext/libmemcached-0.32/m4/ac_cxx_header_stdcxx_98.m4", "ext/libmemcached-0.32/m4/acx_pthread.m4", "ext/libmemcached-0.32/m4/byteorder.m4", "ext/libmemcached-0.32/m4/deprecated.m4", "ext/libmemcached-0.32/m4/enable_utillib.m4", "ext/libmemcached-0.32/m4/extensions.m4", "ext/libmemcached-0.32/m4/hsieh.m4", "ext/libmemcached-0.32/m4/lib-prefix.m4", "ext/libmemcached-0.32/m4/libtool.m4", "ext/libmemcached-0.32/m4/ltoptions.m4", "ext/libmemcached-0.32/m4/ltsugar.m4", "ext/libmemcached-0.32/m4/ltversion.m4", "ext/libmemcached-0.32/m4/lt~obsolete.m4", "ext/libmemcached-0.32/m4/memcached.m4", "ext/libmemcached-0.32/m4/pandora_64bit.m4", "ext/libmemcached-0.32/m4/pandora_canonical.m4", "ext/libmemcached-0.32/m4/pandora_check_compiler_version.m4", "ext/libmemcached-0.32/m4/pandora_check_cxx_standard.m4", "ext/libmemcached-0.32/m4/pandora_enable_dtrace.m4", "ext/libmemcached-0.32/m4/pandora_ensure_gcc_version.m4", "ext/libmemcached-0.32/m4/pandora_have_better_malloc.m4", "ext/libmemcached-0.32/m4/pandora_have_sasl.m4", "ext/libmemcached-0.32/m4/pandora_header_assert.m4", "ext/libmemcached-0.32/m4/pandora_libtool.m4", "ext/libmemcached-0.32/m4/pandora_optimize.m4", "ext/libmemcached-0.32/m4/pandora_shared_ptr.m4", "ext/libmemcached-0.32/m4/pandora_vc_build.m4", "ext/libmemcached-0.32/m4/pandora_warnings.m4", "ext/libmemcached-0.32/m4/pod2man.m4", "ext/libmemcached-0.32/m4/protocol_binary.m4", "ext/libmemcached-0.32/m4/setsockopt.m4", "ext/libmemcached-0.32/m4/visibility.m4", "ext/libmemcached-0.32/support/Makefile.am", "ext/libmemcached-0.32/support/Makefile.in", "ext/libmemcached-0.32/support/libmemcached-fc.spec.in", "ext/libmemcached-0.32/support/libmemcached.pc.in", "ext/libmemcached-0.32/support/libmemcached.spec", "ext/libmemcached-0.32/support/libmemcached.spec.in", "ext/libmemcached-0.32/support/set_benchmark.sh", "ext/libmemcached-0.32/tests/Makefile.am", "ext/libmemcached-0.32/tests/Makefile.in", "ext/libmemcached-0.32/tests/atomsmasher.c", "ext/libmemcached-0.32/tests/function.c", "ext/libmemcached-0.32/tests/ketama_test_cases.h", "ext/libmemcached-0.32/tests/output.cmp", "ext/libmemcached-0.32/tests/output.res", "ext/libmemcached-0.32/tests/output2.res", "ext/libmemcached-0.32/tests/plus.cpp", "ext/libmemcached-0.32/tests/r/memcat.res", "ext/libmemcached-0.32/tests/r/memcp.res", "ext/libmemcached-0.32/tests/r/memrm.res", "ext/libmemcached-0.32/tests/r/memslap.res", "ext/libmemcached-0.32/tests/r/memstat.res", "ext/libmemcached-0.32/tests/server.c", "ext/libmemcached-0.32/tests/server.h", "ext/libmemcached-0.32/tests/start.c", "ext/libmemcached-0.32/tests/t/memcat.test", "ext/libmemcached-0.32/tests/t/memcp.test", "ext/libmemcached-0.32/tests/t/memrm.test", "ext/libmemcached-0.32/tests/t/memslap.test", "ext/libmemcached-0.32/tests/t/memstat.test", "ext/libmemcached-0.32/tests/test.c", "ext/libmemcached-0.32/tests/test.h", "ext/libmemcached-0.32/tests/udp.c", "ext/rlibmemcached.i", "ext/rlibmemcached_wrap.c", "lib/memcached.rb", "lib/memcached/auth.rb", "lib/memcached/behaviors.rb", "lib/memcached/exceptions.rb", "lib/memcached/experimental.rb", "lib/memcached/memcached.rb", "lib/memcached/rails.rb", "test/profile/benchmark.rb", "test/profile/c_profiler.rb", "test/profile/exercise.rb", "test/profile/rb_profiler.rb", "test/profile/valgrind.rb", "test/setup.rb", "test/teardown.rb", "test/test_helper.rb", "test/unit/binding_test.rb", "test/unit/memcached_experimental_test.rb", "test/unit/memcached_test.rb", "test/unit/rails_test.rb", "memcached.gemspec"]
|
15
16
|
s.homepage = %q{http://fauna.github.com/fauna/memcached/}
|
16
17
|
s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Memcached", "--main", "README"]
|
17
18
|
s.require_paths = ["lib", "ext"]
|
18
19
|
s.rubyforge_project = %q{fauna}
|
19
|
-
s.rubygems_version = %q{1.
|
20
|
+
s.rubygems_version = %q{1.6.2}
|
21
|
+
s.signing_key = %q{/Users/eweaver/p/configuration/gem_certificates/evan_weaver-original-private_key.pem}
|
20
22
|
s.summary = %q{An interface to the libmemcached C client.}
|
21
23
|
s.test_files = ["test/test_helper.rb", "test/unit/binding_test.rb", "test/unit/memcached_experimental_test.rb", "test/unit/memcached_test.rb", "test/unit/rails_test.rb"]
|
22
24
|
|
data/test/setup.rb
CHANGED
@@ -9,21 +9,22 @@ unless defined? UNIX_SOCKET_NAME
|
|
9
9
|
# Start memcached
|
10
10
|
verbosity = (ENV['DEBUG'] ? "-vv" : "")
|
11
11
|
log = "/tmp/memcached.log"
|
12
|
+
memcached = ENV['MEMCACHED_COMMAND'] || 'memcached'
|
12
13
|
system ">#{log}"
|
13
14
|
|
14
15
|
# TCP memcached
|
15
16
|
(43042..43046).each do |port|
|
16
|
-
cmd = "memcached #{verbosity} -U 0 -p #{port} >> #{log} 2>&1 &"
|
17
|
+
cmd = "#{memcached} #{verbosity} -U 0 -p #{port} >> #{log} 2>&1 &"
|
17
18
|
raise "'#{cmd}' failed to start" unless system(cmd)
|
18
19
|
end
|
19
20
|
# UDP memcached
|
20
21
|
(43052..43053).each do |port|
|
21
|
-
cmd = "memcached #{verbosity} -U #{port} -p 0 >> #{log} 2>&1 &"
|
22
|
+
cmd = "#{memcached} #{verbosity} -U #{port} -p 0 >> #{log} 2>&1 &"
|
22
23
|
raise "'#{cmd}' failed to start" unless system(cmd)
|
23
24
|
end
|
24
25
|
# Domain socket memcached
|
25
26
|
(0..1).each do |i|
|
26
|
-
cmd = "memcached -M -s #{UNIX_SOCKET_NAME}#{i} #{verbosity} >> #{log} 2>&1 &"
|
27
|
+
cmd = "#{memcached} -M -s #{UNIX_SOCKET_NAME}#{i} #{verbosity} >> #{log} 2>&1 &"
|
27
28
|
raise "'#{cmd}' failed to start" unless system(cmd)
|
28
29
|
end
|
29
30
|
end
|
@@ -51,6 +51,14 @@ class MemcachedExperimentalTest < Test::Unit::TestCase
|
|
51
51
|
end
|
52
52
|
end
|
53
53
|
|
54
|
+
def server_touch_capable
|
55
|
+
@experimental_binary_protocol_cache.set(key, 'touchval')
|
56
|
+
@experimental_binary_protocol_cache.touch(key)
|
57
|
+
yield
|
58
|
+
rescue Memcached::ProtocolError
|
59
|
+
# Skip tests when the server does not support the experimental touch command
|
60
|
+
end
|
61
|
+
|
54
62
|
def test_get_len
|
55
63
|
server_get_len_capable {
|
56
64
|
value = "foobar"
|
@@ -200,6 +208,45 @@ class MemcachedExperimentalTest < Test::Unit::TestCase
|
|
200
208
|
}
|
201
209
|
end
|
202
210
|
|
211
|
+
# Touch command
|
212
|
+
|
213
|
+
def test_touch_capability
|
214
|
+
server_touch_capable {
|
215
|
+
@cache.set(key, "value", 3)
|
216
|
+
assert_nothing_raised do
|
217
|
+
@experimental_binary_protocol_cache.touch(key, 10)
|
218
|
+
end
|
219
|
+
assert_raises(Memcached::ActionNotSupported) do
|
220
|
+
@experimental_cache.touch(key, 10)
|
221
|
+
end
|
222
|
+
}
|
223
|
+
end
|
224
|
+
|
225
|
+
def test_touch_missing_key
|
226
|
+
server_touch_capable {
|
227
|
+
@experimental_binary_protocol_cache.delete key rescue nil
|
228
|
+
assert_raises(Memcached::NotFound) do
|
229
|
+
@experimental_binary_protocol_cache.touch(key, 10)
|
230
|
+
end
|
231
|
+
}
|
232
|
+
end
|
233
|
+
|
234
|
+
def test_touch
|
235
|
+
server_touch_capable {
|
236
|
+
@experimental_binary_protocol_cache.set key, @value, 2
|
237
|
+
assert_equal @value, @experimental_binary_protocol_cache.get(key)
|
238
|
+
sleep(1)
|
239
|
+
assert_equal @value, @experimental_binary_protocol_cache.get(key)
|
240
|
+
@experimental_binary_protocol_cache.touch(key, 3)
|
241
|
+
sleep(2)
|
242
|
+
assert_equal @value, @experimental_binary_protocol_cache.get(key)
|
243
|
+
sleep(2)
|
244
|
+
assert_raises(Memcached::NotFound) do
|
245
|
+
@experimental_binary_protocol_cache.get(key)
|
246
|
+
end
|
247
|
+
}
|
248
|
+
end
|
249
|
+
|
203
250
|
# Memory cleanup
|
204
251
|
|
205
252
|
def test_reset
|
metadata
CHANGED
@@ -1,21 +1,38 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: memcached
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash: 17
|
5
4
|
prerelease:
|
6
|
-
|
7
|
-
- 1
|
8
|
-
- 2
|
9
|
-
- 7
|
10
|
-
version: 1.2.7
|
5
|
+
version: "1.3"
|
11
6
|
platform: ruby
|
12
7
|
authors:
|
13
8
|
- Evan Weaver
|
14
9
|
autorequire:
|
15
10
|
bindir: bin
|
16
|
-
cert_chain:
|
11
|
+
cert_chain:
|
12
|
+
- |
|
13
|
+
-----BEGIN CERTIFICATE-----
|
14
|
+
MIIDLjCCAhagAwIBAgIBADANBgkqhkiG9w0BAQUFADA9MQ0wCwYDVQQDDARldmFu
|
15
|
+
MRgwFgYKCZImiZPyLGQBGRYIY2xvdWRidXIxEjAQBgoJkiaJk/IsZAEZFgJzdDAe
|
16
|
+
Fw0wNzA5MTYxMDMzMDBaFw0wODA5MTUxMDMzMDBaMD0xDTALBgNVBAMMBGV2YW4x
|
17
|
+
GDAWBgoJkiaJk/IsZAEZFghjbG91ZGJ1cjESMBAGCgmSJomT8ixkARkWAnN0MIIB
|
18
|
+
IjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA5C0Io89nyApnr+PvbNFge9Vs
|
19
|
+
yRWAlGBUEMahpXp28VrrfXZT0rAW7JBo4PlCE3jl4nE4dzE6gAdItSycjTosrw7A
|
20
|
+
Ir5+xoyl4Vb35adv56TIQQXvNz+BzlqnkAY5JN0CSBRTQb6mxS3hFyD/h4qgDosj
|
21
|
+
R2RFVzHqSxCS8xq4Ny8uzOwOi+Xyu4w67fI5JvnPvMxqrlR1eaIQHmxnf76RzC46
|
22
|
+
QO5QhufjAYGGXd960XzbQsQyTDUYJzrvT7AdOfiyZzKQykKt8dEpDn+QPjFTnGnT
|
23
|
+
QmgJBX5WJN0lHF2l1sbv3gh4Kn1tZu+kTUqeXY6ShAoDTyvZRiFqQdwh8w2lTQID
|
24
|
+
AQABozkwNzAJBgNVHRMEAjAAMAsGA1UdDwQEAwIEsDAdBgNVHQ4EFgQU+WqJz3xQ
|
25
|
+
XSea1hRvvHWcIMgeeC4wDQYJKoZIhvcNAQEFBQADggEBAGLZ75jfOEW8Nsl26CTt
|
26
|
+
JFrWxQTcQT/UljeefVE3xYr7lc9oQjbqO3FOyued3qW7TaNEtZfSHoYeUSMYbpw1
|
27
|
+
XAwocIPuSRFDGM4B+hgQGVDx8PMGiJKom4qLXjO40UZsR7QyN/u869Vj45LURm6h
|
28
|
+
MBcPeqCASI+WNprj9+uZa2kmHiitrFqqfMBNlm5IFbn9XeYSta9AHVvs5QQqV2m5
|
29
|
+
hIPfLqCyxsn/YgOGvo6iwyQTWyTswamaAC3HRWZxIS1sfn/Ssqa7E7oQMkv5FAXr
|
30
|
+
x5rKePfXINf8XTJczkl9OBEYdE9aNdJsJpXD0asLgGVwBICS5Bjohp6mizJcDC1+
|
31
|
+
yZ0=
|
32
|
+
-----END CERTIFICATE-----
|
17
33
|
|
18
|
-
date: 2011-
|
34
|
+
date: 2011-08-04 00:00:00 -07:00
|
35
|
+
default_executable:
|
19
36
|
dependencies: []
|
20
37
|
|
21
38
|
description: An interface to the libmemcached C client.
|
@@ -179,6 +196,8 @@ files:
|
|
179
196
|
- ext/libmemcached-0.32/libmemcached/memcached_strerror.c
|
180
197
|
- ext/libmemcached-0.32/libmemcached/memcached_string.c
|
181
198
|
- ext/libmemcached-0.32/libmemcached/memcached_string.h
|
199
|
+
- ext/libmemcached-0.32/libmemcached/memcached_touch.c
|
200
|
+
- ext/libmemcached-0.32/libmemcached/memcached_touch.h
|
182
201
|
- ext/libmemcached-0.32/libmemcached/memcached_types.h
|
183
202
|
- ext/libmemcached-0.32/libmemcached/memcached_util.h
|
184
203
|
- ext/libmemcached-0.32/libmemcached/memcached_verbosity.c
|
@@ -277,6 +296,7 @@ files:
|
|
277
296
|
- test/unit/memcached_test.rb
|
278
297
|
- test/unit/rails_test.rb
|
279
298
|
- memcached.gemspec
|
299
|
+
has_rdoc: true
|
280
300
|
homepage: http://fauna.github.com/fauna/memcached/
|
281
301
|
licenses: []
|
282
302
|
|
@@ -296,24 +316,17 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
296
316
|
requirements:
|
297
317
|
- - ">="
|
298
318
|
- !ruby/object:Gem::Version
|
299
|
-
hash: 3
|
300
|
-
segments:
|
301
|
-
- 0
|
302
319
|
version: "0"
|
303
320
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
304
321
|
none: false
|
305
322
|
requirements:
|
306
323
|
- - ">="
|
307
324
|
- !ruby/object:Gem::Version
|
308
|
-
hash: 11
|
309
|
-
segments:
|
310
|
-
- 1
|
311
|
-
- 2
|
312
325
|
version: "1.2"
|
313
326
|
requirements: []
|
314
327
|
|
315
328
|
rubyforge_project: fauna
|
316
|
-
rubygems_version: 1.
|
329
|
+
rubygems_version: 1.6.2
|
317
330
|
signing_key:
|
318
331
|
specification_version: 3
|
319
332
|
summary: An interface to the libmemcached C client.
|
metadata.gz.sig
ADDED
Binary file
|