memcached 1.2.6 → 1.2.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (225) hide show
  1. data/CHANGELOG +2 -0
  2. data/Manifest +206 -12
  3. data/Rakefile +32 -1
  4. data/ext/extconf.rb +10 -35
  5. data/ext/libmemcached-0.32/AUTHORS +7 -0
  6. data/ext/libmemcached-0.32/COPYING +32 -0
  7. data/ext/libmemcached-0.32/ChangeLog +303 -0
  8. data/ext/libmemcached-0.32/INSTALL +302 -0
  9. data/ext/libmemcached-0.32/Makefile.am +36 -0
  10. data/ext/libmemcached-0.32/Makefile.in +828 -0
  11. data/ext/libmemcached-0.32/NEWS +1 -0
  12. data/ext/libmemcached-0.32/README +33 -0
  13. data/ext/libmemcached-0.32/THANKS +14 -0
  14. data/ext/libmemcached-0.32/TODO +11 -0
  15. data/ext/libmemcached-0.32/aclocal.m4 +1852 -0
  16. data/ext/libmemcached-0.32/clients/Makefile.am +73 -0
  17. data/ext/libmemcached-0.32/clients/Makefile.in +770 -0
  18. data/ext/libmemcached-0.32/clients/client_options.h +32 -0
  19. data/ext/libmemcached-0.32/clients/execute.c +64 -0
  20. data/ext/libmemcached-0.32/clients/execute.h +5 -0
  21. data/ext/libmemcached-0.32/clients/generator.c +74 -0
  22. data/ext/libmemcached-0.32/clients/generator.h +20 -0
  23. data/ext/libmemcached-0.32/clients/memcat.c +178 -0
  24. data/ext/libmemcached-0.32/clients/memcp.c +251 -0
  25. data/ext/libmemcached-0.32/clients/memdump.c +170 -0
  26. data/ext/libmemcached-0.32/clients/memerror.c +80 -0
  27. data/ext/libmemcached-0.32/clients/memflush.c +143 -0
  28. data/ext/libmemcached-0.32/clients/memrm.c +160 -0
  29. data/ext/libmemcached-0.32/clients/memslap.c +441 -0
  30. data/ext/libmemcached-0.32/clients/memstat.c +326 -0
  31. data/ext/libmemcached-0.32/clients/utilities.c +207 -0
  32. data/ext/libmemcached-0.32/clients/utilities.h +41 -0
  33. data/ext/libmemcached-0.32/config.h.in +252 -0
  34. data/ext/libmemcached-0.32/config/compile +143 -0
  35. data/ext/libmemcached-0.32/config/config.guess +1561 -0
  36. data/ext/libmemcached-0.32/config/config.rpath +666 -0
  37. data/ext/libmemcached-0.32/config/config.sub +1686 -0
  38. data/ext/libmemcached-0.32/config/depcomp +630 -0
  39. data/ext/libmemcached-0.32/config/install-sh +520 -0
  40. data/ext/libmemcached-0.32/config/ltmain.sh +8406 -0
  41. data/ext/libmemcached-0.32/config/missing +376 -0
  42. data/ext/libmemcached-0.32/configure +23048 -0
  43. data/ext/libmemcached-0.32/configure.ac +122 -0
  44. data/ext/libmemcached-0.32/docs/Makefile.am +415 -0
  45. data/ext/libmemcached-0.32/docs/Makefile.in +918 -0
  46. data/ext/libmemcached-0.32/docs/libmemcached.pod +123 -0
  47. data/ext/libmemcached-0.32/docs/libmemcached_examples.pod +115 -0
  48. data/ext/libmemcached-0.32/docs/libmemcachedutil.pod +40 -0
  49. data/ext/libmemcached-0.32/docs/memcached_analyze.pod +52 -0
  50. data/ext/libmemcached-0.32/docs/memcached_auto.pod +97 -0
  51. data/ext/libmemcached-0.32/docs/memcached_behavior.pod +224 -0
  52. data/ext/libmemcached-0.32/docs/memcached_callback.pod +123 -0
  53. data/ext/libmemcached-0.32/docs/memcached_create.pod +61 -0
  54. data/ext/libmemcached-0.32/docs/memcached_delete.pod +54 -0
  55. data/ext/libmemcached-0.32/docs/memcached_dump.pod +53 -0
  56. data/ext/libmemcached-0.32/docs/memcached_flush.pod +46 -0
  57. data/ext/libmemcached-0.32/docs/memcached_flush_buffers.pod +42 -0
  58. data/ext/libmemcached-0.32/docs/memcached_generate_hash_value.pod +57 -0
  59. data/ext/libmemcached-0.32/docs/memcached_get.pod +161 -0
  60. data/ext/libmemcached-0.32/docs/memcached_memory_allocators.pod +73 -0
  61. data/ext/libmemcached-0.32/docs/memcached_pool.pod +77 -0
  62. data/ext/libmemcached-0.32/docs/memcached_quit.pod +47 -0
  63. data/ext/libmemcached-0.32/docs/memcached_sasl.pod +63 -0
  64. data/ext/libmemcached-0.32/docs/memcached_server_st.pod +75 -0
  65. data/ext/libmemcached-0.32/docs/memcached_servers.pod +102 -0
  66. data/ext/libmemcached-0.32/docs/memcached_set.pod +187 -0
  67. data/ext/libmemcached-0.32/docs/memcached_stats.pod +82 -0
  68. data/ext/libmemcached-0.32/docs/memcached_strerror.pod +46 -0
  69. data/ext/libmemcached-0.32/docs/memcached_user_data.pod +49 -0
  70. data/ext/libmemcached-0.32/docs/memcached_verbosity.pod +41 -0
  71. data/ext/libmemcached-0.32/docs/memcached_version.pod +56 -0
  72. data/ext/libmemcached-0.32/docs/memcat.pod +37 -0
  73. data/ext/libmemcached-0.32/docs/memcp.pod +40 -0
  74. data/ext/libmemcached-0.32/docs/memdump.pod +31 -0
  75. data/ext/libmemcached-0.32/docs/memerror.pod +30 -0
  76. data/ext/libmemcached-0.32/docs/memflush.pod +35 -0
  77. data/ext/libmemcached-0.32/docs/memrm.pod +34 -0
  78. data/ext/libmemcached-0.32/docs/memslap.pod +33 -0
  79. data/ext/libmemcached-0.32/docs/memstat.pod +35 -0
  80. data/ext/libmemcached-0.32/libmemcached/Makefile.am +107 -0
  81. data/ext/libmemcached-0.32/libmemcached/Makefile.in +1050 -0
  82. data/ext/libmemcached-0.32/libmemcached/byteorder.c +31 -0
  83. data/ext/libmemcached-0.32/libmemcached/common.h +183 -0
  84. data/ext/libmemcached-0.32/libmemcached/crc.c +86 -0
  85. data/ext/libmemcached-0.32/libmemcached/hsieh_hash.c +68 -0
  86. data/ext/libmemcached-0.32/libmemcached/jenkins_hash.c +213 -0
  87. data/ext/libmemcached-0.32/libmemcached/libmemcached.ver +1 -0
  88. data/ext/libmemcached-0.32/libmemcached/libmemcached_probes.d +28 -0
  89. data/ext/libmemcached-0.32/libmemcached/libmemcached_probes.h +78 -0
  90. data/ext/libmemcached-0.32/libmemcached/md5.c +354 -0
  91. data/ext/libmemcached-0.32/libmemcached/memcached.c +152 -0
  92. data/ext/libmemcached-0.32/libmemcached/memcached.h +302 -0
  93. data/ext/libmemcached-0.32/libmemcached/memcached.hpp +799 -0
  94. data/ext/libmemcached-0.32/libmemcached/memcached/README.txt +7 -0
  95. data/ext/libmemcached-0.32/libmemcached/memcached/protocol_binary.h +366 -0
  96. data/ext/libmemcached-0.32/libmemcached/memcached_allocators.c +72 -0
  97. data/ext/libmemcached-0.32/libmemcached/memcached_analyze.c +100 -0
  98. data/ext/libmemcached-0.32/libmemcached/memcached_auto.c +207 -0
  99. data/ext/libmemcached-0.32/libmemcached/memcached_behavior.c +285 -0
  100. data/ext/libmemcached-0.32/libmemcached/memcached_callback.c +175 -0
  101. data/ext/libmemcached-0.32/libmemcached/memcached_configure.h.in +23 -0
  102. data/ext/libmemcached-0.32/libmemcached/memcached_connect.c +361 -0
  103. data/ext/libmemcached-0.32/libmemcached/memcached_constants.h +145 -0
  104. data/ext/libmemcached-0.32/libmemcached/memcached_delete.c +0 -0
  105. data/ext/libmemcached-0.32/libmemcached/memcached_do.c +34 -0
  106. data/ext/libmemcached-0.32/libmemcached/memcached_dump.c +79 -0
  107. data/ext/libmemcached-0.32/libmemcached/memcached_fetch.c +102 -0
  108. data/ext/libmemcached-0.32/libmemcached/memcached_flush.c +89 -0
  109. data/ext/libmemcached-0.32/libmemcached/memcached_flush_buffers.c +22 -0
  110. data/ext/libmemcached-0.32/libmemcached/memcached_get.c +495 -0
  111. data/ext/libmemcached-0.32/libmemcached/memcached_get.h +87 -0
  112. data/ext/libmemcached-0.32/libmemcached/memcached_hash.c +252 -0
  113. data/ext/libmemcached-0.32/libmemcached/memcached_hosts.c +510 -0
  114. data/ext/libmemcached-0.32/libmemcached/memcached_internal.h +31 -0
  115. data/ext/libmemcached-0.32/libmemcached/memcached_io.c +547 -0
  116. data/ext/libmemcached-0.32/libmemcached/memcached_io.h +59 -0
  117. data/ext/libmemcached-0.32/libmemcached/memcached_key.c +28 -0
  118. data/ext/libmemcached-0.32/libmemcached/memcached_parse.c +74 -0
  119. data/ext/libmemcached-0.32/libmemcached/memcached_pool.h +38 -0
  120. data/ext/libmemcached-0.32/libmemcached/memcached_purge.c +76 -0
  121. data/ext/libmemcached-0.32/libmemcached/memcached_quit.c +75 -0
  122. data/ext/libmemcached-0.32/libmemcached/memcached_response.c +528 -0
  123. data/ext/libmemcached-0.32/libmemcached/memcached_result.c +57 -0
  124. data/ext/libmemcached-0.32/libmemcached/memcached_result.h +59 -0
  125. data/ext/libmemcached-0.32/libmemcached/memcached_sasl.c +225 -0
  126. data/ext/libmemcached-0.32/libmemcached/memcached_sasl.h +44 -0
  127. data/ext/libmemcached-0.32/libmemcached/memcached_server.c +159 -0
  128. data/ext/libmemcached-0.32/libmemcached/memcached_server.h +93 -0
  129. data/ext/libmemcached-0.32/libmemcached/memcached_stats.c +454 -0
  130. data/ext/libmemcached-0.32/libmemcached/memcached_storage.c +514 -0
  131. data/ext/libmemcached-0.32/libmemcached/memcached_storage.h +107 -0
  132. data/ext/libmemcached-0.32/libmemcached/memcached_strerror.c +92 -0
  133. data/ext/libmemcached-0.32/libmemcached/memcached_string.c +138 -0
  134. data/ext/libmemcached-0.32/libmemcached/memcached_string.h +53 -0
  135. data/ext/libmemcached-0.32/libmemcached/memcached_types.h +44 -0
  136. data/ext/libmemcached-0.32/libmemcached/memcached_util.h +15 -0
  137. data/ext/libmemcached-0.32/libmemcached/memcached_verbosity.c +36 -0
  138. data/ext/libmemcached-0.32/libmemcached/memcached_version.c +112 -0
  139. data/ext/libmemcached-0.32/libmemcached/memcached_watchpoint.h +38 -0
  140. data/ext/libmemcached-0.32/libmemcached/murmur_hash.c +76 -0
  141. data/ext/libmemcached-0.32/libmemcached/visibility.h +51 -0
  142. data/ext/libmemcached-0.32/libmemcachedutil/Makefile.am +11 -0
  143. data/ext/libmemcached-0.32/libmemcachedutil/Makefile.in +602 -0
  144. data/ext/libmemcached-0.32/libmemcachedutil/libmemcachedutil.ver +1 -0
  145. data/ext/libmemcached-0.32/libmemcachedutil/memcached_pool.c +170 -0
  146. data/ext/libmemcached-0.32/m4/ac_cxx_compile_stdcxx_0x.m4 +103 -0
  147. data/ext/libmemcached-0.32/m4/ac_cxx_header_stdcxx_98.m4 +67 -0
  148. data/ext/libmemcached-0.32/m4/acx_pthread.m4 +276 -0
  149. data/ext/libmemcached-0.32/m4/byteorder.m4 +40 -0
  150. data/ext/libmemcached-0.32/m4/deprecated.m4 +17 -0
  151. data/ext/libmemcached-0.32/m4/enable_utillib.m4 +16 -0
  152. data/ext/libmemcached-0.32/m4/extensions.m4 +94 -0
  153. data/ext/libmemcached-0.32/m4/hsieh.m4 +18 -0
  154. data/ext/libmemcached-0.32/m4/lib-prefix.m4 +221 -0
  155. data/ext/libmemcached-0.32/m4/libtool.m4 +7360 -0
  156. data/ext/libmemcached-0.32/m4/ltoptions.m4 +368 -0
  157. data/ext/libmemcached-0.32/m4/ltsugar.m4 +123 -0
  158. data/ext/libmemcached-0.32/m4/ltversion.m4 +23 -0
  159. data/ext/libmemcached-0.32/m4/lt~obsolete.m4 +92 -0
  160. data/ext/libmemcached-0.32/m4/memcached.m4 +30 -0
  161. data/ext/libmemcached-0.32/m4/pandora_64bit.m4 +55 -0
  162. data/ext/libmemcached-0.32/m4/pandora_canonical.m4 +151 -0
  163. data/ext/libmemcached-0.32/m4/pandora_check_compiler_version.m4 +37 -0
  164. data/ext/libmemcached-0.32/m4/pandora_check_cxx_standard.m4 +16 -0
  165. data/ext/libmemcached-0.32/m4/pandora_enable_dtrace.m4 +41 -0
  166. data/ext/libmemcached-0.32/m4/pandora_ensure_gcc_version.m4 +36 -0
  167. data/ext/libmemcached-0.32/m4/pandora_have_better_malloc.m4 +54 -0
  168. data/ext/libmemcached-0.32/m4/pandora_have_sasl.m4 +133 -0
  169. data/ext/libmemcached-0.32/m4/pandora_header_assert.m4 +23 -0
  170. data/ext/libmemcached-0.32/m4/pandora_libtool.m4 +15 -0
  171. data/ext/libmemcached-0.32/m4/pandora_optimize.m4 +79 -0
  172. data/ext/libmemcached-0.32/m4/pandora_shared_ptr.m4 +56 -0
  173. data/ext/libmemcached-0.32/m4/pandora_vc_build.m4 +32 -0
  174. data/ext/libmemcached-0.32/m4/pandora_warnings.m4 +262 -0
  175. data/ext/libmemcached-0.32/m4/pod2man.m4 +7 -0
  176. data/ext/libmemcached-0.32/m4/protocol_binary.m4 +23 -0
  177. data/ext/libmemcached-0.32/m4/setsockopt.m4 +57 -0
  178. data/ext/libmemcached-0.32/m4/visibility.m4 +52 -0
  179. data/ext/libmemcached-0.32/support/Makefile.am +4 -0
  180. data/ext/libmemcached-0.32/support/Makefile.in +485 -0
  181. data/ext/libmemcached-0.32/support/libmemcached-fc.spec.in +105 -0
  182. data/ext/libmemcached-0.32/support/libmemcached.pc.in +10 -0
  183. data/ext/libmemcached-0.32/support/libmemcached.spec +105 -0
  184. data/ext/libmemcached-0.32/support/libmemcached.spec.in +105 -0
  185. data/ext/libmemcached-0.32/support/set_benchmark.sh +5 -0
  186. data/ext/libmemcached-0.32/tests/Makefile.am +105 -0
  187. data/ext/libmemcached-0.32/tests/Makefile.in +748 -0
  188. data/ext/libmemcached-0.32/tests/atomsmasher.c +245 -0
  189. data/ext/libmemcached-0.32/tests/function.c +4781 -0
  190. data/ext/libmemcached-0.32/tests/ketama_test_cases.h +108 -0
  191. data/ext/libmemcached-0.32/tests/output.cmp +7 -0
  192. data/ext/libmemcached-0.32/tests/output.res +7 -0
  193. data/ext/libmemcached-0.32/tests/output2.res +46 -0
  194. data/ext/libmemcached-0.32/tests/plus.cpp +293 -0
  195. data/ext/libmemcached-0.32/tests/r/memcat.res +19 -0
  196. data/ext/libmemcached-0.32/tests/r/memcp.res +27 -0
  197. data/ext/libmemcached-0.32/tests/r/memrm.res +19 -0
  198. data/ext/libmemcached-0.32/tests/r/memslap.res +33 -0
  199. data/ext/libmemcached-0.32/tests/r/memstat.res +33 -0
  200. data/ext/libmemcached-0.32/tests/server.c +118 -0
  201. data/ext/libmemcached-0.32/tests/server.h +25 -0
  202. data/ext/libmemcached-0.32/tests/start.c +16 -0
  203. data/ext/libmemcached-0.32/tests/t/memcat.test +4 -0
  204. data/ext/libmemcached-0.32/tests/t/memcp.test +3 -0
  205. data/ext/libmemcached-0.32/tests/t/memrm.test +3 -0
  206. data/ext/libmemcached-0.32/tests/t/memslap.test +5 -0
  207. data/ext/libmemcached-0.32/tests/t/memstat.test +3 -0
  208. data/ext/libmemcached-0.32/tests/test.c +137 -0
  209. data/ext/libmemcached-0.32/tests/test.h +46 -0
  210. data/ext/libmemcached-0.32/tests/udp.c +76 -0
  211. data/memcached.gemspec +4 -4
  212. data/test/unit/memcached_test.rb +30 -0
  213. metadata +213 -16
  214. data/ext/libmemcached-0.32.tar.gz +0 -0
  215. data/ext/libmemcached-1.patch +0 -270
  216. data/ext/libmemcached-10.patch +0 -12
  217. data/ext/libmemcached-2.patch +0 -116
  218. data/ext/libmemcached-3.patch +0 -8
  219. data/ext/libmemcached-4.patch +0 -40
  220. data/ext/libmemcached-5.patch +0 -832
  221. data/ext/libmemcached-6.patch +0 -20
  222. data/ext/libmemcached-7.patch +0 -2989
  223. data/ext/libmemcached-8.patch +0 -137
  224. data/ext/libmemcached-9.patch +0 -13
  225. data/ext/sasl.patch +0 -29283
@@ -0,0 +1,108 @@
1
+ typedef struct {
2
+ const char *key;
3
+ unsigned long hash1;
4
+ unsigned long hash2;
5
+ const char *server;
6
+ } TestCase;
7
+
8
+ static TestCase test_cases[99] = {
9
+ { "SVa_]_V41)", 443691461UL, 445379617UL, "10.0.1.7" },
10
+ { "*/Z;?V(.\\8", 1422915503UL, 1428303028UL, "10.0.1.1" },
11
+ { "30C1*Z*S/_", 1473165754UL, 1480075959UL, "10.0.1.2" },
12
+ { "ERR:EC58G>", 2148406511UL, 2168579133UL, "10.0.1.7" },
13
+ { "1I=cTMNTKF", 2882686667UL, 2885206587UL, "10.0.1.5" },
14
+ { "]VG<`I*Z8)", 1103544263UL, 1104827657UL, "10.0.1.5" },
15
+ { "UUTC`-V159", 3716288206UL, 3727224240UL, "10.0.1.5" },
16
+ { "@7RU6C6T+Z", 3862737685UL, 3871917949UL, "10.0.1.5" },
17
+ { "/XLN0@+36;", 1623269830UL, 1627683651UL, "10.0.1.1" },
18
+ { "4(`X;\\V.^c", 373546328UL, 383925769UL, "10.0.1.1" },
19
+ { "726bW=9*a4", 4213440020UL, 4213950705UL, "10.0.1.7" },
20
+ { "\\`)<B)UE,c", 951096736UL, 955226069UL, "10.0.1.1" },
21
+ { "P1[Ma3=K1/", 1989324036UL, 1994028240UL, "10.0.1.8" },
22
+ { "C89I.-V?cT", 1604239957UL, 1606398093UL, "10.0.1.8" },
23
+ { "D[HE+cFXDK", 2117036136UL, 2117124014UL, "10.0.1.3" },
24
+ { "P1L?NAB[)K", 2129972569UL, 2132542634UL, "10.0.1.1" },
25
+ { "cDT0)Z5P6,", 176485284UL, 178675413UL, "10.0.1.5" },
26
+ { "@JW`+[WAO8", 2720940826UL, 2743975456UL, "10.0.1.5" },
27
+ { "\\39DKW^)N_", 3548879868UL, 3550704865UL, "10.0.1.3" },
28
+ { "EM75N0+[X1", 1558531507UL, 1559308507UL, "10.0.1.4" },
29
+ { "`,SS]NBP,b", 1883545960UL, 1884847278UL, "10.0.1.1" },
30
+ { "XX1a9LT+F?", 653487707UL, 656410408UL, "10.0.1.5" },
31
+ { "Zc\\-,F-c6V", 1160802451UL, 1171575728UL, "10.0.1.5" },
32
+ { "1*RTMC7,03", 1602398012UL, 1606398093UL, "10.0.1.8" },
33
+ { "*Xc+V0P>32", 536016577UL, 539988520UL, "10.0.1.7" },
34
+ { "U))Fb-(`,.", 4128682289UL, 4136854163UL, "10.0.1.7" },
35
+ { "R-08RNTaRT", 3718170086UL, 3727224240UL, "10.0.1.5" },
36
+ { "(LHcO203I3", 1007779411UL, 1014643570UL, "10.0.1.5" },
37
+ { "=256P+;Qc8", 3976201210UL, 3976304873UL, "10.0.1.5" },
38
+ { "OI5XZ_BBT(", 2155922164UL, 2168579133UL, "10.0.1.7" },
39
+ { "2TLRL/UL;:", 1086800909UL, 1095659802UL, "10.0.1.7" },
40
+ { "WHD\\O1`ZRW", 3087923411UL, 3095471560UL, "10.0.1.5" },
41
+ { ".=54)_c;=T", 2497691631UL, 2502731301UL, "10.0.1.1" },
42
+ { ";G<W-XWZ@b", 2888169733UL, 2888728739UL, "10.0.1.5" },
43
+ { "(,>E`)FT\\4", 580747448UL, 581063326UL, "10.0.1.2" },
44
+ { "HZAU*;P*N]", 2564670474UL, 2565697267UL, "10.0.1.7" },
45
+ { "NZ@ZE=O84_", 533335275UL, 539988520UL, "10.0.1.7" },
46
+ { "6,cEI`F_P>", 3972869246UL, 3974773167UL, "10.0.1.6" },
47
+ { "c,5AQ/T5)6", 2835605783UL, 2847870057UL, "10.0.1.8" },
48
+ { ".O,>>BT)RX", 3857978174UL, 3871917949UL, "10.0.1.5" },
49
+ { "XY\\X::LX50", 1749241099UL, 1752196488UL, "10.0.1.6" },
50
+ { "+550F^/.01", 3781824099UL, 3783248219UL, "10.0.1.6" },
51
+ { "<.X9E2S5+9", 3232479481UL, 3234387706UL, "10.0.1.7" },
52
+ { "]\\.UH8_0a1", 2419699252UL, 2423002920UL, "10.0.1.4" },
53
+ { "8(6=(T0/Z0", 728266737UL, 729026070UL, "10.0.1.7" },
54
+ { "8*6a;Sc*X+", 4223431086UL, 4230156966UL, "10.0.1.2" },
55
+ { "<QW:;3K6;H", 2731158143UL, 2743975456UL, "10.0.1.5" },
56
+ { "7C@EY@-Y?_", 760770733UL, 761576669UL, "10.0.1.5" },
57
+ { "aPb3E1WD4K", 2500489218UL, 2502731301UL, "10.0.1.1" },
58
+ { "?@12R<=1BH", 1494795329UL, 1502505505UL, "10.0.1.8" },
59
+ { "QR(a+Q=1FU", 3238535074UL, 3238996435UL, "10.0.1.6" },
60
+ { "`C9^FV,960", 2628553463UL, 2628733766UL, "10.0.1.6" },
61
+ { "UNHVP..^8H", 977096483UL, 977319837UL, "10.0.1.4" },
62
+ { ":Y.2W2[(35", 2777083668UL, 2784182515UL, "10.0.1.7" },
63
+ { "M/HV^_HZ4O", 3623390946UL, 3624445007UL, "10.0.1.7" },
64
+ { "ZY16KQ<ICD", 1831153193UL, 1838563516UL, "10.0.1.4" },
65
+ { "bV2,`a.PY9", 1962228869UL, 1962648654UL, "10.0.1.1" },
66
+ { "U;9:-+5N]9", 269504649UL, 277560877UL, "10.0.1.1" },
67
+ { "1S/:aJ[1(;", 578069729UL, 581063326UL, "10.0.1.2" },
68
+ { "Nb-X^]M)I:", 330865696UL, 331009896UL, "10.0.1.6" },
69
+ { "2;M;ES>J5/", 2776949824UL, 2784182515UL, "10.0.1.7" },
70
+ { "[>RZHG97Q9", 71954686UL, 72034069UL, "10.0.1.6" },
71
+ { "J3/G[)9<^Z", 2799896459UL, 2805183696UL, "10.0.1.7" },
72
+ { "N-)88>[O`,", 50404102UL, 51792557UL, "10.0.1.5" },
73
+ { "NP:=FR\\OaA", 3837333776UL, 3837792034UL, "10.0.1.7" },
74
+ { "`@L+W;a,O[", 1512157148UL, 1522285852UL, "10.0.1.6" },
75
+ { "W2`P:-+1T[", 2945171975UL, 2946196424UL, "10.0.1.5" },
76
+ { "-6G7K^YDIN", 3168617340UL, 3170513015UL, "10.0.1.7" },
77
+ { "U>*>9ZI6V5", 668514946UL, 674097631UL, "10.0.1.6" },
78
+ { ".I?^6Ic9RK", 938419020UL, 942832691UL, "10.0.1.6" },
79
+ { "0OZH^9BKM[", 3682518606UL, 3686781297UL, "10.0.1.8" },
80
+ { "5?50UGZ:ML", 868610882UL, 869425986UL, "10.0.1.5" },
81
+ { "?K2NF@3=IU", 381218851UL, 383925769UL, "10.0.1.1" },
82
+ { "YI@G-2X?UB", 3688706179UL, 3693197681UL, "10.0.1.5" },
83
+ { "7cY</BSaL=", 3976870223UL, 3978903843UL, "10.0.1.6" },
84
+ { "A(`KF:[RH8", 3292979676UL, 3294849139UL, "10.0.1.6" },
85
+ { ";=ZT\\W^P+H", 1401102653UL, 1416290674UL, "10.0.1.4" },
86
+ { "b2?WFF56;R", 480494704UL, 486971192UL, "10.0.1.4" },
87
+ { "CTR74,J+N.", 137446045UL, 146633907UL, "10.0.1.8" },
88
+ { "<b;*R+QDST", 1304985302UL, 1308223778UL, "10.0.1.5" },
89
+ { "\\R^7=9UCG`", 126218373UL, 129199837UL, "10.0.1.5" },
90
+ { "1bQS5]WOXB", 1853470245UL, 1855329369UL, "10.0.1.4" },
91
+ { "M(@X^b[L:K", 3019630308UL, 3022260113UL, "10.0.1.1" },
92
+ { "431cBF8,YO", 1679726993UL, 1685224295UL, "10.0.1.7" },
93
+ { "(bEIQJ:E./", 2922607787UL, 2925521819UL, "10.0.1.6" },
94
+ { "WS/3H*)7F;", 419488232UL, 422140585UL, "10.0.1.5" },
95
+ { "ZJF[Ia6Q)+", 3960568056UL, 3962489998UL, "10.0.1.7" },
96
+ { "<]*QCK8U,>", 2590140172UL, 2598117636UL, "10.0.1.7" },
97
+ { "\\[a\\^=V_M0", 689410119UL, 698690782UL, "10.0.1.6" },
98
+ { "7;RM+8J9YC", 1530175299UL, 1531107082UL, "10.0.1.7" },
99
+ { "4*=.SPR[AV", 3928582722UL, 3928853792UL, "10.0.1.1" },
100
+ { "-2F+^88P4U", 3023552752UL, 3025823613UL, "10.0.1.7" },
101
+ { "X;-F`(N?9D", 570465234UL, 572485994UL, "10.0.1.7" },
102
+ { "R=F_D-K2a]", 1287750228UL, 1290935562UL, "10.0.1.7" },
103
+ { "X*+2aaC.EG", 3200948713UL, 3201088518UL, "10.0.1.5" },
104
+ { "[1ZXONX2]a", 4108881567UL, 4109865744UL, "10.0.1.4" },
105
+ { "FL;\\GWacaV", 458449508UL, 467374054UL, "10.0.1.4" },
106
+ { "\\MQ_XNT7L-", 1259349383UL, 1259509450UL, "10.0.1.7" },
107
+ { "VD6D0]ba_\\", 3842502950UL, 3842588691UL, "10.0.1.1" },
108
+ };
@@ -0,0 +1,7 @@
1
+ servers localhost:11221,localhost:11222,localhost:11223,localhost:11224,localhost:11225,
2
+ localhost : 11221
3
+ localhost : 11222
4
+ localhost : 11223
5
+ localhost : 11224
6
+ localhost : 11225
7
+
@@ -0,0 +1,7 @@
1
+ servers localhost:11221,localhost:11222,localhost:11223,localhost:11224,localhost:11225,
2
+ localhost : 11221
3
+ localhost : 11222
4
+ localhost : 11223
5
+ localhost : 11224
6
+ localhost : 11225
7
+
@@ -0,0 +1,46 @@
1
+ Error 0 -> SUCCESS
2
+ Error 1 -> FAILURE
3
+ Error 2 -> HOSTNAME LOOKUP FAILURE
4
+ Error 3 -> CONNECTION FAILURE
5
+ Error 4 -> CONNECTION BIND FAILURE
6
+ Error 5 -> WRITE FAILURE
7
+ Error 6 -> READ FAILURE
8
+ Error 7 -> UNKNOWN READ FAILURE
9
+ Error 8 -> PROTOCOL ERROR
10
+ Error 9 -> CLIENT ERROR
11
+ Error 10 -> SERVER ERROR
12
+ Error 11 -> CONNECTION SOCKET CREATE FAILURE
13
+ Error 12 -> CONNECTION DATA EXISTS
14
+ Error 13 -> CONNECTION DATA DOES NOT EXIST
15
+ Error 14 -> NOT STORED
16
+ Error 15 -> NOT FOUND
17
+ Error 16 -> MEMORY ALLOCATION FAILURE
18
+ Error 17 -> PARTIAL READ
19
+ Error 18 -> SOME ERRORS WERE REPORTED
20
+ Error 19 -> NO SERVERS DEFINED
21
+ Found key pid
22
+ Found key uptime
23
+ Found key time
24
+ Found key version
25
+ Found key pointer_size
26
+ Found key rusage_user
27
+ Found key rusage_system
28
+ Found key rusage_user_seconds
29
+ Found key rusage_user_microseconds
30
+ Found key rusage_system_seconds
31
+ Found key rusage_system_microseconds
32
+ Found key curr_items
33
+ Found key total_items
34
+ Found key bytes
35
+ Found key curr_connections
36
+ Found key total_connections
37
+ Found key connection_structures
38
+ Found key cmd_get
39
+ Found key cmd_set
40
+ Found key get_hits
41
+ Found key get_misses
42
+ Found key evictions
43
+ Found key bytes_read
44
+ Found key bytes_written
45
+ Found key limit_maxbytes
46
+ Found key threads
@@ -0,0 +1,293 @@
1
+ /*
2
+ C++ interface test
3
+ */
4
+ #include "libmemcached/memcached.hpp"
5
+
6
+ #include <assert.h>
7
+ #include <stdio.h>
8
+ #include <stdlib.h>
9
+ #include <string.h>
10
+ #include <sys/time.h>
11
+ #include <sys/types.h>
12
+ #include <sys/stat.h>
13
+ #include <unistd.h>
14
+ #include <time.h>
15
+ #include "server.h"
16
+
17
+ #include "test.h"
18
+
19
+ #include <string>
20
+
21
+ using namespace std;
22
+ using namespace memcache;
23
+
24
+ extern "C" {
25
+ test_return basic_test(memcached_st *memc);
26
+ test_return increment_test(memcached_st *memc);
27
+ test_return basic_master_key_test(memcached_st *memc);
28
+ test_return mget_result_function(memcached_st *memc);
29
+ test_return mget_test(memcached_st *memc);
30
+ memcached_return callback_counter(memcached_st *,
31
+ memcached_result_st *,
32
+ void *context);
33
+ void *world_create(void);
34
+ void world_destroy(void *p);
35
+ }
36
+
37
+ static void populate_vector(vector<char> &vec, const string &str)
38
+ {
39
+ vec.reserve(str.length());
40
+ vec.assign(str.begin(), str.end());
41
+ }
42
+
43
+ static void copy_vec_to_string(vector<char> &vec, string &str)
44
+ {
45
+ str.clear();
46
+ if (! vec.empty())
47
+ {
48
+ str.assign(vec.begin(), vec.end());
49
+ }
50
+ }
51
+
52
+ test_return basic_test(memcached_st *memc)
53
+ {
54
+ Memcache foo(memc);
55
+ const string value_set("This is some data");
56
+ std::vector<char> value;
57
+ std::vector<char> test_value;
58
+
59
+ populate_vector(value, value_set);
60
+
61
+ foo.set("mine", value, 0, 0);
62
+ foo.get("mine", test_value);
63
+
64
+ assert((memcmp(&test_value[0], &value[0], test_value.size()) == 0));
65
+
66
+ return TEST_SUCCESS;
67
+ }
68
+
69
+ test_return increment_test(memcached_st *memc)
70
+ {
71
+ Memcache mcach(memc);
72
+ bool rc;
73
+ const string key("blah");
74
+ const string inc_value("1");
75
+ std::vector<char> inc_val;
76
+ vector<char> ret_value;
77
+ string ret_string;
78
+ uint64_t int_inc_value;
79
+ uint64_t int_ret_value;
80
+
81
+ populate_vector(inc_val, inc_value);
82
+
83
+ rc= mcach.set(key, inc_val, 0, 0);
84
+ if (rc == false)
85
+ {
86
+ return TEST_FAILURE;
87
+ }
88
+ mcach.get(key, ret_value);
89
+ if (ret_value.empty())
90
+ {
91
+ return TEST_FAILURE;
92
+ }
93
+ copy_vec_to_string(ret_value, ret_string);
94
+
95
+ int_inc_value= uint64_t(atol(inc_value.c_str()));
96
+ int_ret_value= uint64_t(atol(ret_string.c_str()));
97
+ assert(int_ret_value == int_inc_value);
98
+
99
+ rc= mcach.increment(key, 1, &int_ret_value);
100
+ assert(rc == true);
101
+ assert(int_ret_value == 2);
102
+
103
+ rc= mcach.increment(key, 1, &int_ret_value);
104
+ assert(rc == true);
105
+ assert(int_ret_value == 3);
106
+
107
+ rc= mcach.increment(key, 5, &int_ret_value);
108
+ assert(rc == true);
109
+ assert(int_ret_value == 8);
110
+
111
+ return TEST_SUCCESS;
112
+ }
113
+
114
+ test_return basic_master_key_test(memcached_st *memc)
115
+ {
116
+ Memcache foo(memc);
117
+ const string value_set("Data for server A");
118
+ vector<char> value;
119
+ vector<char> test_value;
120
+ const string master_key_a("server-a");
121
+ const string master_key_b("server-b");
122
+ const string key("xyz");
123
+
124
+ populate_vector(value, value_set);
125
+
126
+ foo.setByKey(master_key_a, key, value, 0, 0);
127
+ foo.getByKey(master_key_a, key, test_value);
128
+
129
+ assert((memcmp(&value[0], &test_value[0], value.size()) == 0));
130
+
131
+ test_value.clear();
132
+
133
+ foo.getByKey(master_key_b, key, test_value);
134
+ assert((memcmp(&value[0], &test_value[0], value.size()) == 0));
135
+
136
+ return TEST_SUCCESS;
137
+ }
138
+
139
+ /* Count the results */
140
+ memcached_return callback_counter(memcached_st *,
141
+ memcached_result_st *,
142
+ void *context)
143
+ {
144
+ unsigned int *counter= static_cast<unsigned int *>(context);
145
+
146
+ *counter= *counter + 1;
147
+
148
+ return MEMCACHED_SUCCESS;
149
+ }
150
+
151
+ test_return mget_result_function(memcached_st *memc)
152
+ {
153
+ Memcache mc(memc);
154
+ bool rc;
155
+ string key1("fudge");
156
+ string key2("son");
157
+ string key3("food");
158
+ vector<string> keys;
159
+ vector< vector<char> *> values;
160
+ vector<char> val1;
161
+ vector<char> val2;
162
+ vector<char> val3;
163
+ populate_vector(val1, key1);
164
+ populate_vector(val2, key2);
165
+ populate_vector(val3, key3);
166
+ keys.reserve(3);
167
+ keys.push_back(key1);
168
+ keys.push_back(key2);
169
+ keys.push_back(key3);
170
+ values.reserve(3);
171
+ values.push_back(&val1);
172
+ values.push_back(&val2);
173
+ values.push_back(&val3);
174
+ unsigned int counter;
175
+ memcached_execute_function callbacks[1];
176
+
177
+ /* We need to empty the server before we continue the test */
178
+ rc= mc.flush(0);
179
+ rc= mc.setAll(keys, values, 50, 9);
180
+ assert(rc == true);
181
+
182
+ rc= mc.mget(keys);
183
+ assert(rc == true);
184
+
185
+ callbacks[0]= &callback_counter;
186
+ counter= 0;
187
+ rc= mc.fetchExecute(callbacks, static_cast<void *>(&counter), 1);
188
+
189
+ assert(counter == 3);
190
+
191
+ return TEST_SUCCESS;
192
+ }
193
+
194
+ test_return mget_test(memcached_st *memc)
195
+ {
196
+ Memcache mc(memc);
197
+ bool rc;
198
+ memcached_return mc_rc;
199
+ vector<string> keys;
200
+ vector< vector<char> *> values;
201
+ keys.reserve(3);
202
+ keys.push_back("fudge");
203
+ keys.push_back("son");
204
+ keys.push_back("food");
205
+ vector<char> val1;
206
+ vector<char> val2;
207
+ vector<char> val3;
208
+ populate_vector(val1, "fudge");
209
+ populate_vector(val2, "son");
210
+ populate_vector(val3, "food");
211
+ values.reserve(3);
212
+ values.push_back(&val1);
213
+ values.push_back(&val2);
214
+ values.push_back(&val3);
215
+
216
+ string return_key;
217
+ vector<char> return_value;
218
+
219
+ /* We need to empty the server before we continue the test */
220
+ rc= mc.flush(0);
221
+ assert(rc == true);
222
+
223
+ rc= mc.mget(keys);
224
+ assert(rc == true);
225
+
226
+ while ((mc_rc= mc.fetch(return_key, return_value)) != MEMCACHED_END)
227
+ {
228
+ assert(return_value.size() != 0);
229
+ return_value.clear();
230
+ }
231
+ assert(mc_rc == MEMCACHED_END);
232
+
233
+ rc= mc.setAll(keys, values, 50, 9);
234
+ assert(rc == true);
235
+
236
+ rc= mc.mget(keys);
237
+ assert(rc == true);
238
+
239
+ while ((mc_rc= mc.fetch(return_key, return_value)) != MEMCACHED_END)
240
+ {
241
+ assert(return_key.length() == return_value.size());
242
+ assert(!memcmp(&return_value[0], return_key.c_str(), return_value.size()));
243
+ }
244
+
245
+ return TEST_SUCCESS;
246
+ }
247
+
248
+ test_st tests[] ={
249
+ { "basic", 0, basic_test },
250
+ { "basic_master_key", 0, basic_master_key_test },
251
+ { "increment_test", 0, increment_test },
252
+ { "mget", 1, mget_test },
253
+ { "mget_result_function", 1, mget_result_function },
254
+ {0, 0, 0}
255
+ };
256
+
257
+ collection_st collection[] ={
258
+ {"block", 0, 0, tests},
259
+ {0, 0, 0, 0}
260
+ };
261
+
262
+ #define SERVERS_TO_CREATE 1
263
+
264
+ extern "C" void *world_create(void)
265
+ {
266
+ server_startup_st *construct;
267
+
268
+ construct= (server_startup_st *)malloc(sizeof(server_startup_st));
269
+ memset(construct, 0, sizeof(server_startup_st));
270
+
271
+ construct->count= SERVERS_TO_CREATE;
272
+ server_startup(construct);
273
+
274
+ return construct;
275
+ }
276
+
277
+ void world_destroy(void *p)
278
+ {
279
+ server_startup_st *construct= static_cast<server_startup_st *>(p);
280
+ memcached_server_st *servers=
281
+ static_cast<memcached_server_st *>(construct->servers);
282
+ memcached_server_list_free(servers);
283
+
284
+ server_shutdown(construct);
285
+ free(construct);
286
+ }
287
+
288
+ void get_world(world_st *world)
289
+ {
290
+ world->collections= collection;
291
+ world->create= world_create;
292
+ world->destroy= world_destroy;
293
+ }