nutcracker 0.2.4.4 → 0.2.4.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (293) hide show
  1. data/README.md +1 -1
  2. data/ext/nutcracker/ChangeLog +0 -0
  3. data/ext/nutcracker/LICENSE +0 -0
  4. data/ext/nutcracker/Makefile +643 -0
  5. data/ext/nutcracker/Makefile.am +0 -0
  6. data/ext/nutcracker/Makefile.in +82 -190
  7. data/ext/nutcracker/NOTICE +0 -0
  8. data/ext/nutcracker/README.md +0 -0
  9. data/ext/nutcracker/aclocal.m4 +122 -231
  10. data/ext/nutcracker/autom4te.cache/output.0 +18664 -0
  11. data/ext/nutcracker/autom4te.cache/output.1 +18664 -0
  12. data/ext/nutcracker/autom4te.cache/output.2 +18664 -0
  13. data/ext/nutcracker/autom4te.cache/requests +494 -0
  14. data/ext/nutcracker/autom4te.cache/traces.0 +2415 -0
  15. data/ext/nutcracker/autom4te.cache/traces.1 +945 -0
  16. data/ext/nutcracker/autom4te.cache/traces.2 +2415 -0
  17. data/ext/nutcracker/conf/nutcracker.leaf.yml +0 -0
  18. data/ext/nutcracker/conf/nutcracker.root.yml +0 -0
  19. data/ext/nutcracker/conf/nutcracker.yml +0 -0
  20. data/ext/nutcracker/config.h +332 -0
  21. data/ext/nutcracker/config.h.in +15 -0
  22. data/ext/nutcracker/config.log +2684 -0
  23. data/ext/nutcracker/config.status +2317 -0
  24. data/ext/nutcracker/config/config.guess +248 -278
  25. data/ext/nutcracker/config/config.sub +77 -234
  26. data/ext/nutcracker/config/depcomp +39 -143
  27. data/ext/nutcracker/config/install-sh +116 -136
  28. data/ext/nutcracker/config/ltmain.sh +788 -1704
  29. data/ext/nutcracker/config/missing +65 -29
  30. data/ext/nutcracker/configure +1068 -2014
  31. data/ext/nutcracker/configure.ac +34 -2
  32. data/ext/nutcracker/contrib/Makefile +494 -0
  33. data/ext/nutcracker/contrib/Makefile.am +0 -0
  34. data/ext/nutcracker/contrib/Makefile.in +47 -120
  35. data/ext/nutcracker/contrib/yaml-0.1.4.tar.gz +0 -0
  36. data/ext/nutcracker/contrib/yaml-0.1.4/Makefile +736 -0
  37. data/ext/nutcracker/contrib/yaml-0.1.4/autom4te.cache/output.0 +13102 -0
  38. data/ext/nutcracker/contrib/yaml-0.1.4/autom4te.cache/output.1 +13085 -0
  39. data/ext/nutcracker/contrib/yaml-0.1.4/autom4te.cache/output.2 +13085 -0
  40. data/ext/nutcracker/contrib/yaml-0.1.4/autom4te.cache/requests +476 -0
  41. data/ext/nutcracker/contrib/yaml-0.1.4/autom4te.cache/traces.0 +2339 -0
  42. data/ext/nutcracker/contrib/yaml-0.1.4/autom4te.cache/traces.1 +545 -0
  43. data/ext/nutcracker/contrib/yaml-0.1.4/autom4te.cache/traces.2 +2339 -0
  44. data/ext/nutcracker/contrib/yaml-0.1.4/config.h +81 -0
  45. data/ext/nutcracker/contrib/yaml-0.1.4/config.h.in~ +80 -0
  46. data/ext/nutcracker/contrib/yaml-0.1.4/config.log +688 -0
  47. data/ext/nutcracker/contrib/yaml-0.1.4/config.status +2032 -0
  48. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/annotated.html +51 -0
  49. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/bc_s.png +0 -0
  50. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/classes.html +41 -0
  51. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/closed.png +0 -0
  52. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/doxygen.css +656 -0
  53. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/doxygen.png +0 -0
  54. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/files.html +40 -0
  55. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions.html +91 -0
  56. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_0x62.html +84 -0
  57. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_0x63.html +87 -0
  58. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_0x64.html +83 -0
  59. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_0x65.html +110 -0
  60. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_0x66.html +79 -0
  61. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_0x68.html +80 -0
  62. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_0x69.html +92 -0
  63. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_0x6b.html +71 -0
  64. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_0x6c.html +88 -0
  65. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_0x6d.html +96 -0
  66. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_0x6e.html +71 -0
  67. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_0x6f.html +80 -0
  68. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_0x70.html +100 -0
  69. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_0x71.html +71 -0
  70. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_0x72.html +87 -0
  71. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_0x73.html +163 -0
  72. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_0x74.html +115 -0
  73. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_0x75.html +71 -0
  74. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_0x76.html +80 -0
  75. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_0x77.html +77 -0
  76. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_vars.html +91 -0
  77. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_vars_0x62.html +84 -0
  78. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_vars_0x63.html +87 -0
  79. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_vars_0x64.html +83 -0
  80. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_vars_0x65.html +110 -0
  81. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_vars_0x66.html +79 -0
  82. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_vars_0x68.html +80 -0
  83. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_vars_0x69.html +92 -0
  84. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_vars_0x6b.html +71 -0
  85. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_vars_0x6c.html +88 -0
  86. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_vars_0x6d.html +96 -0
  87. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_vars_0x6e.html +71 -0
  88. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_vars_0x6f.html +80 -0
  89. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_vars_0x70.html +100 -0
  90. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_vars_0x71.html +71 -0
  91. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_vars_0x72.html +87 -0
  92. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_vars_0x73.html +163 -0
  93. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_vars_0x74.html +115 -0
  94. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_vars_0x75.html +71 -0
  95. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_vars_0x76.html +80 -0
  96. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_vars_0x77.html +77 -0
  97. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/globals.html +667 -0
  98. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/globals_defs.html +81 -0
  99. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/globals_enum.html +78 -0
  100. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/globals_eval.html +373 -0
  101. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/globals_func.html +196 -0
  102. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/globals_type.html +126 -0
  103. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/group__basic.html +320 -0
  104. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/group__emitter.html +819 -0
  105. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/group__events.html +664 -0
  106. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/group__export.html +60 -0
  107. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/group__nodes.html +795 -0
  108. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/group__parser.html +606 -0
  109. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/group__styles.html +222 -0
  110. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/group__tokens.html +246 -0
  111. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/group__version.html +106 -0
  112. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/index.html +31 -0
  113. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/modules.html +42 -0
  114. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/nav_f.png +0 -0
  115. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/nav_h.png +0 -0
  116. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/open.png +0 -0
  117. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/structyaml__alias__data__s.html +108 -0
  118. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/structyaml__document__s.html +235 -0
  119. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/structyaml__emitter__s.html +1300 -0
  120. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/structyaml__event__s.html +496 -0
  121. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/structyaml__mark__s.html +108 -0
  122. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/structyaml__node__pair__s.html +91 -0
  123. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/structyaml__node__s.html +420 -0
  124. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/structyaml__parser__s.html +1229 -0
  125. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/structyaml__simple__key__s.html +97 -0
  126. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/structyaml__tag__directive__s.html +91 -0
  127. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/structyaml__token__s.html +413 -0
  128. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/structyaml__version__directive__s.html +91 -0
  129. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/tab_a.png +0 -0
  130. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/tab_b.png +0 -0
  131. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/tab_h.png +0 -0
  132. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/tab_s.png +0 -0
  133. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/tabs.css +59 -0
  134. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/yaml_8h.html +525 -0
  135. data/ext/nutcracker/contrib/yaml-0.1.4/include/Makefile.am +17 -0
  136. data/ext/nutcracker/contrib/yaml-0.1.4/include/Makefile.in +470 -0
  137. data/ext/nutcracker/contrib/yaml-0.1.4/libtool +8890 -0
  138. data/ext/nutcracker/contrib/yaml-0.1.4/src/Makefile +484 -0
  139. data/ext/nutcracker/contrib/yaml-0.1.4/src/api.lo +12 -0
  140. data/ext/nutcracker/contrib/yaml-0.1.4/src/api.o +0 -0
  141. data/ext/nutcracker/contrib/yaml-0.1.4/src/dumper.lo +12 -0
  142. data/ext/nutcracker/contrib/yaml-0.1.4/src/dumper.o +0 -0
  143. data/ext/nutcracker/contrib/yaml-0.1.4/src/emitter.lo +12 -0
  144. data/ext/nutcracker/contrib/yaml-0.1.4/src/emitter.o +0 -0
  145. data/ext/nutcracker/contrib/yaml-0.1.4/src/libyaml.la +41 -0
  146. data/ext/nutcracker/contrib/yaml-0.1.4/src/loader.lo +12 -0
  147. data/ext/nutcracker/contrib/yaml-0.1.4/src/loader.o +0 -0
  148. data/ext/nutcracker/contrib/yaml-0.1.4/src/parser.lo +12 -0
  149. data/ext/nutcracker/contrib/yaml-0.1.4/src/parser.o +0 -0
  150. data/ext/nutcracker/contrib/yaml-0.1.4/src/reader.lo +12 -0
  151. data/ext/nutcracker/contrib/yaml-0.1.4/src/reader.o +0 -0
  152. data/ext/nutcracker/contrib/yaml-0.1.4/src/scanner.lo +12 -0
  153. data/ext/nutcracker/contrib/yaml-0.1.4/src/scanner.o +0 -0
  154. data/ext/nutcracker/contrib/yaml-0.1.4/src/writer.lo +12 -0
  155. data/ext/nutcracker/contrib/yaml-0.1.4/src/writer.o +0 -0
  156. data/ext/nutcracker/contrib/yaml-0.1.4/stamp-h1 +1 -0
  157. data/ext/nutcracker/contrib/yaml-0.1.4/tests/Makefile +675 -0
  158. data/ext/nutcracker/contrib/yaml-0.1.4/tests/example-deconstructor +0 -0
  159. data/ext/nutcracker/contrib/yaml-0.1.4/tests/example-deconstructor-alt +0 -0
  160. data/ext/nutcracker/contrib/yaml-0.1.4/tests/example-deconstructor-alt.o +0 -0
  161. data/ext/nutcracker/contrib/yaml-0.1.4/tests/example-deconstructor.o +0 -0
  162. data/ext/nutcracker/contrib/yaml-0.1.4/tests/example-reformatter +0 -0
  163. data/ext/nutcracker/contrib/yaml-0.1.4/tests/example-reformatter-alt +0 -0
  164. data/ext/nutcracker/contrib/yaml-0.1.4/tests/example-reformatter-alt.o +0 -0
  165. data/ext/nutcracker/contrib/yaml-0.1.4/tests/example-reformatter.o +0 -0
  166. data/ext/nutcracker/contrib/yaml-0.1.4/tests/run-dumper +0 -0
  167. data/ext/nutcracker/contrib/yaml-0.1.4/tests/run-dumper.o +0 -0
  168. data/ext/nutcracker/contrib/yaml-0.1.4/tests/run-emitter +0 -0
  169. data/ext/nutcracker/contrib/yaml-0.1.4/tests/run-emitter.o +0 -0
  170. data/ext/nutcracker/contrib/yaml-0.1.4/tests/run-loader +0 -0
  171. data/ext/nutcracker/contrib/yaml-0.1.4/tests/run-loader.o +0 -0
  172. data/ext/nutcracker/contrib/yaml-0.1.4/tests/run-parser +0 -0
  173. data/ext/nutcracker/contrib/yaml-0.1.4/tests/run-parser.o +0 -0
  174. data/ext/nutcracker/contrib/yaml-0.1.4/tests/run-scanner +0 -0
  175. data/ext/nutcracker/contrib/yaml-0.1.4/tests/run-scanner.o +0 -0
  176. data/ext/nutcracker/contrib/yaml-0.1.4/yaml-0.1.pc +10 -0
  177. data/ext/nutcracker/contrib/yaml-0.1.4/yaml-0.1.pc.in +10 -0
  178. data/ext/nutcracker/exconf.rb +0 -0
  179. data/ext/nutcracker/extconf.rb +2 -5
  180. data/ext/nutcracker/libtool +9403 -0
  181. data/ext/nutcracker/m4/libtool.m4 +396 -960
  182. data/ext/nutcracker/m4/ltoptions.m4 +2 -17
  183. data/ext/nutcracker/m4/ltversion.m4 +6 -6
  184. data/ext/nutcracker/notes/c-styleguide.txt +0 -0
  185. data/ext/nutcracker/notes/debug.txt +0 -0
  186. data/ext/nutcracker/notes/memcache.txt +0 -0
  187. data/ext/nutcracker/notes/recommendation.md +0 -0
  188. data/ext/nutcracker/notes/redis.md +0 -0
  189. data/ext/nutcracker/notes/socket.txt +0 -0
  190. data/ext/nutcracker/scripts/nutcracker.init +0 -0
  191. data/ext/nutcracker/scripts/nutcracker.spec +0 -0
  192. data/ext/nutcracker/scripts/redis-check.py +0 -0
  193. data/ext/nutcracker/src/Makefile +647 -0
  194. data/ext/nutcracker/src/Makefile.am +1 -1
  195. data/ext/nutcracker/src/Makefile.in +81 -167
  196. data/ext/nutcracker/src/hashkit/Makefile +476 -0
  197. data/ext/nutcracker/src/hashkit/Makefile.am +0 -0
  198. data/ext/nutcracker/src/hashkit/Makefile.in +37 -72
  199. data/ext/nutcracker/src/hashkit/libhashkit.a +0 -0
  200. data/ext/nutcracker/src/hashkit/nc_crc16.c +0 -0
  201. data/ext/nutcracker/src/hashkit/nc_crc16.o +0 -0
  202. data/ext/nutcracker/src/hashkit/nc_crc32.c +0 -0
  203. data/ext/nutcracker/src/hashkit/nc_crc32.o +0 -0
  204. data/ext/nutcracker/src/hashkit/nc_fnv.c +0 -0
  205. data/ext/nutcracker/src/hashkit/nc_fnv.o +0 -0
  206. data/ext/nutcracker/src/hashkit/nc_hashkit.h +0 -0
  207. data/ext/nutcracker/src/hashkit/nc_hsieh.c +0 -0
  208. data/ext/nutcracker/src/hashkit/nc_hsieh.o +0 -0
  209. data/ext/nutcracker/src/hashkit/nc_jenkins.c +0 -0
  210. data/ext/nutcracker/src/hashkit/nc_jenkins.o +0 -0
  211. data/ext/nutcracker/src/hashkit/nc_ketama.c +0 -0
  212. data/ext/nutcracker/src/hashkit/nc_ketama.o +0 -0
  213. data/ext/nutcracker/src/hashkit/nc_md5.c +0 -0
  214. data/ext/nutcracker/src/hashkit/nc_md5.o +0 -0
  215. data/ext/nutcracker/src/hashkit/nc_modula.c +0 -0
  216. data/ext/nutcracker/src/hashkit/nc_modula.o +0 -0
  217. data/ext/nutcracker/src/hashkit/nc_murmur.c +0 -0
  218. data/ext/nutcracker/src/hashkit/nc_murmur.o +0 -0
  219. data/ext/nutcracker/src/hashkit/nc_one_at_a_time.c +0 -0
  220. data/ext/nutcracker/src/hashkit/nc_one_at_a_time.o +0 -0
  221. data/ext/nutcracker/src/hashkit/nc_random.c +0 -0
  222. data/ext/nutcracker/src/hashkit/nc_random.o +0 -0
  223. data/ext/nutcracker/src/nc.c +0 -0
  224. data/ext/nutcracker/src/nc.o +0 -0
  225. data/ext/nutcracker/src/nc_array.c +0 -0
  226. data/ext/nutcracker/src/nc_array.h +0 -0
  227. data/ext/nutcracker/src/nc_array.o +0 -0
  228. data/ext/nutcracker/src/nc_client.c +0 -0
  229. data/ext/nutcracker/src/nc_client.h +0 -0
  230. data/ext/nutcracker/src/nc_client.o +0 -0
  231. data/ext/nutcracker/src/nc_conf.c +0 -0
  232. data/ext/nutcracker/src/nc_conf.h +0 -0
  233. data/ext/nutcracker/src/nc_conf.o +0 -0
  234. data/ext/nutcracker/src/nc_connection.c +0 -0
  235. data/ext/nutcracker/src/nc_connection.h +0 -0
  236. data/ext/nutcracker/src/nc_connection.o +0 -0
  237. data/ext/nutcracker/src/nc_core.c +29 -26
  238. data/ext/nutcracker/src/nc_core.h +13 -5
  239. data/ext/nutcracker/src/nc_core.o +0 -0
  240. data/ext/nutcracker/src/{nc_event.c → nc_epoll.c} +94 -30
  241. data/ext/nutcracker/src/nc_epoll.o +0 -0
  242. data/ext/nutcracker/src/nc_event.h +33 -13
  243. data/ext/nutcracker/src/nc_kqueue.c +296 -0
  244. data/ext/nutcracker/src/nc_kqueue.o +0 -0
  245. data/ext/nutcracker/src/nc_log.c +0 -0
  246. data/ext/nutcracker/src/nc_log.h +0 -0
  247. data/ext/nutcracker/src/nc_log.o +0 -0
  248. data/ext/nutcracker/src/nc_mbuf.c +0 -0
  249. data/ext/nutcracker/src/nc_mbuf.h +0 -0
  250. data/ext/nutcracker/src/nc_mbuf.o +0 -0
  251. data/ext/nutcracker/src/nc_message.c +0 -0
  252. data/ext/nutcracker/src/nc_message.h +0 -0
  253. data/ext/nutcracker/src/nc_message.o +0 -0
  254. data/ext/nutcracker/src/nc_proxy.c +8 -8
  255. data/ext/nutcracker/src/nc_proxy.h +0 -0
  256. data/ext/nutcracker/src/nc_proxy.o +0 -0
  257. data/ext/nutcracker/src/nc_queue.h +0 -0
  258. data/ext/nutcracker/src/nc_rbtree.c +0 -0
  259. data/ext/nutcracker/src/nc_rbtree.h +0 -0
  260. data/ext/nutcracker/src/nc_rbtree.o +0 -0
  261. data/ext/nutcracker/src/nc_request.c +3 -3
  262. data/ext/nutcracker/src/nc_request.o +0 -0
  263. data/ext/nutcracker/src/nc_response.c +4 -6
  264. data/ext/nutcracker/src/nc_response.o +0 -0
  265. data/ext/nutcracker/src/nc_server.c +5 -5
  266. data/ext/nutcracker/src/nc_server.h +0 -0
  267. data/ext/nutcracker/src/nc_server.o +0 -0
  268. data/ext/nutcracker/src/nc_signal.c +0 -0
  269. data/ext/nutcracker/src/nc_signal.h +0 -0
  270. data/ext/nutcracker/src/nc_signal.o +0 -0
  271. data/ext/nutcracker/src/nc_stats.c +16 -21
  272. data/ext/nutcracker/src/nc_stats.h +3 -4
  273. data/ext/nutcracker/src/nc_stats.o +0 -0
  274. data/ext/nutcracker/src/nc_string.c +0 -0
  275. data/ext/nutcracker/src/nc_string.h +0 -0
  276. data/ext/nutcracker/src/nc_string.o +0 -0
  277. data/ext/nutcracker/src/nc_util.c +16 -0
  278. data/ext/nutcracker/src/nc_util.h +1 -0
  279. data/ext/nutcracker/src/nc_util.o +0 -0
  280. data/ext/nutcracker/src/nutcracker +0 -0
  281. data/ext/nutcracker/src/proto/Makefile +454 -0
  282. data/ext/nutcracker/src/proto/Makefile.am +0 -0
  283. data/ext/nutcracker/src/proto/Makefile.in +37 -72
  284. data/ext/nutcracker/src/proto/libproto.a +0 -0
  285. data/ext/nutcracker/src/proto/nc_memcache.c +0 -0
  286. data/ext/nutcracker/src/proto/nc_memcache.o +0 -0
  287. data/ext/nutcracker/src/proto/nc_proto.h +0 -0
  288. data/ext/nutcracker/src/proto/nc_redis.c +0 -0
  289. data/ext/nutcracker/src/proto/nc_redis.o +0 -0
  290. data/ext/nutcracker/stamp-h1 +1 -0
  291. data/lib/nutcracker.rb +95 -4
  292. data/lib/nutcracker/version.rb +1 -1
  293. metadata +217 -4
@@ -40,10 +40,20 @@
40
40
  # define NC_STATS 0
41
41
  #endif
42
42
 
43
+ #ifdef HAVE_EPOLL
44
+ #define NC_HAVE_EPOLL 1
45
+ #elif HAVE_KQUEUE
46
+ #define NC_HAVE_KQUEUE 1
47
+ #endif
48
+
43
49
  #ifdef HAVE_LITTLE_ENDIAN
44
50
  # define NC_LITTLE_ENDIAN 1
45
51
  #endif
46
52
 
53
+ #ifdef HAVE_BACKTRACE
54
+ #define NC_HAVE_BACKTRACE 1
55
+ #endif
56
+
47
57
  #define NC_OK 0
48
58
  #define NC_ERROR -1
49
59
  #define NC_EAGAIN -2
@@ -101,14 +111,12 @@ struct context {
101
111
  struct stats *stats; /* stats */
102
112
 
103
113
  struct array pool; /* server_pool[] */
104
-
105
- int ep; /* epoll device */
106
- int nevent; /* # epoll event */
114
+ struct evbase *evb;
107
115
  int max_timeout; /* epoll wait max timeout in msec */
108
- int timeout; /* epoll wait timeout in msec */
109
- struct epoll_event *event; /* epoll event */
116
+ int timeout;
110
117
  };
111
118
 
119
+
112
120
  struct instance {
113
121
  struct context *ctx; /* active context */
114
122
  int log_level; /* log level */
@@ -16,66 +16,86 @@
16
16
  */
17
17
 
18
18
  #include <unistd.h>
19
- #include <sys/epoll.h>
20
-
21
19
  #include <nc_core.h>
22
20
  #include <nc_event.h>
23
21
 
24
- int
25
- event_init(struct context *ctx, int size)
22
+ #ifdef NC_HAVE_EPOLL
23
+ #include <sys/epoll.h>
24
+
25
+ struct evbase *
26
+ evbase_create(int nevent, void (*callback_fp)(void *, uint32_t))
26
27
  {
28
+
29
+ struct evbase *evb;
27
30
  int status, ep;
28
31
  struct epoll_event *event;
29
32
 
30
- ASSERT(ctx->ep < 0);
31
- ASSERT(ctx->nevent != 0);
32
- ASSERT(ctx->event == NULL);
33
+ if (nevent <= 0) {
34
+ log_error("nevent has to be positive %d", nevent);
35
+ return NULL;
36
+ }
33
37
 
34
- ep = epoll_create(size);
38
+ ep = epoll_create(nevent);
35
39
  if (ep < 0) {
36
- log_error("epoll create of size %d failed: %s", size, strerror(errno));
37
- return -1;
40
+ log_error("epoll create of size %d failed: %s", nevent, strerror(errno));
41
+ return NULL;
38
42
  }
39
43
 
40
- event = nc_calloc(ctx->nevent, sizeof(*ctx->event));
44
+ event = nc_calloc(nevent, sizeof(*event));
41
45
  if (event == NULL) {
42
46
  status = close(ep);
43
47
  if (status < 0) {
44
48
  log_error("close e %d failed, ignored: %s", ep, strerror(errno));
45
49
  }
46
- return -1;
50
+ return NULL;
47
51
  }
48
52
 
49
- ctx->ep = ep;
50
- ctx->event = event;
53
+ evb = nc_alloc(sizeof(*evb));
54
+ if (evb == NULL) {
55
+ nc_free(event);
56
+ status = close(ep);
57
+ if (status < 0) {
58
+ log_error("close e %d failed, ignored: %s", ep, strerror(errno));
59
+ }
60
+ return NULL;
51
61
 
52
- log_debug(LOG_INFO, "e %d with nevent %d timeout %d", ctx->ep,
53
- ctx->nevent, ctx->timeout);
62
+ }
54
63
 
55
- return 0;
64
+ evb->nevent = nevent;
65
+ evb->ep = ep;
66
+ evb->event = event;
67
+ evb->callback_fp = callback_fp;
68
+
69
+ log_debug(LOG_INFO, "e %d with nevent %d", evb->ep,
70
+ evb->nevent);
71
+
72
+ return evb;
56
73
  }
57
74
 
58
75
  void
59
- event_deinit(struct context *ctx)
76
+ evbase_destroy(struct evbase *evb)
60
77
  {
61
78
  int status;
62
79
 
63
- ASSERT(ctx->ep >= 0);
80
+ if (evb == NULL) return;
64
81
 
65
- nc_free(ctx->event);
82
+ ASSERT(evb->ep >= 0);
66
83
 
67
- status = close(ctx->ep);
84
+ nc_free(evb->event);
85
+
86
+ status = close(evb->ep);
68
87
  if (status < 0) {
69
- log_error("close e %d failed, ignored: %s", ctx->ep, strerror(errno));
88
+ log_error("close e %d failed, ignored: %s", evb->ep, strerror(errno));
70
89
  }
71
- ctx->ep = -1;
90
+ nc_free(evb);
72
91
  }
73
92
 
74
93
  int
75
- event_add_out(int ep, struct conn *c)
94
+ event_add_out(struct evbase *evb, struct conn *c)
76
95
  {
77
96
  int status;
78
97
  struct epoll_event event;
98
+ int ep = evb->ep;
79
99
 
80
100
  ASSERT(ep > 0);
81
101
  ASSERT(c != NULL);
@@ -101,10 +121,11 @@ event_add_out(int ep, struct conn *c)
101
121
  }
102
122
 
103
123
  int
104
- event_del_out(int ep, struct conn *c)
124
+ event_del_out(struct evbase *evb, struct conn *c)
105
125
  {
106
126
  int status;
107
127
  struct epoll_event event;
128
+ int ep = evb->ep;
108
129
 
109
130
  ASSERT(ep > 0);
110
131
  ASSERT(c != NULL);
@@ -130,10 +151,11 @@ event_del_out(int ep, struct conn *c)
130
151
  }
131
152
 
132
153
  int
133
- event_add_conn(int ep, struct conn *c)
154
+ event_add_conn(struct evbase *evb, struct conn *c)
134
155
  {
135
156
  int status;
136
157
  struct epoll_event event;
158
+ int ep = evb->ep;
137
159
 
138
160
  ASSERT(ep > 0);
139
161
  ASSERT(c != NULL);
@@ -155,9 +177,10 @@ event_add_conn(int ep, struct conn *c)
155
177
  }
156
178
 
157
179
  int
158
- event_del_conn(int ep, struct conn *c)
180
+ event_del_conn(struct evbase *evb, struct conn *c)
159
181
  {
160
182
  int status;
183
+ int ep = evb->ep;
161
184
 
162
185
  ASSERT(ep > 0);
163
186
  ASSERT(c != NULL);
@@ -176,9 +199,14 @@ event_del_conn(int ep, struct conn *c)
176
199
  }
177
200
 
178
201
  int
179
- event_wait(int ep, struct epoll_event *event, int nevent, int timeout)
202
+ event_wait(struct evbase *evb, int timeout)
180
203
  {
181
- int nsd;
204
+ int nsd, i;
205
+ uint32_t evflags = 0;
206
+ int ep = evb->ep;
207
+ struct epoll_event *event = evb->event;
208
+ int nevent = evb->nevent;
209
+ void (*callback_fp)(void *, uint32_t) = evb->callback_fp;
182
210
 
183
211
  ASSERT(ep > 0);
184
212
  ASSERT(event != NULL);
@@ -187,6 +215,22 @@ event_wait(int ep, struct epoll_event *event, int nevent, int timeout)
187
215
  for (;;) {
188
216
  nsd = epoll_wait(ep, event, nevent, timeout);
189
217
  if (nsd > 0) {
218
+ for (i = 0; i < nsd; i++) {
219
+ struct epoll_event *ev = &evb->event[i];
220
+
221
+ evflags = 0;
222
+ if (ev->events & EPOLLERR)
223
+ evflags |= EV_ERR;
224
+
225
+ if (ev->events & EPOLLIN)
226
+ evflags |= EV_READ;
227
+
228
+ if (ev->events & EPOLLOUT)
229
+ evflags |= EV_WRITE;
230
+
231
+ if (callback_fp != NULL)
232
+ (*callback_fp)((void *) ev->data.ptr, evflags);
233
+ }
190
234
  return nsd;
191
235
  }
192
236
 
@@ -209,6 +253,26 @@ event_wait(int ep, struct epoll_event *event, int nevent, int timeout)
209
253
 
210
254
  return -1;
211
255
  }
212
-
213
256
  NOT_REACHED();
214
257
  }
258
+
259
+ int
260
+ event_add_st(struct evbase *evb, int fd)
261
+ {
262
+ int status;
263
+ struct epoll_event ev;
264
+
265
+ ev.data.fd = fd;
266
+ ev.events = EPOLLIN;
267
+
268
+ status = epoll_ctl(evb->ep, EPOLL_CTL_ADD, fd, &ev);
269
+ if (status < 0) {
270
+ log_error("epoll ctl on e %d sd %d failed: %s", evb->ep, fd,
271
+ strerror(errno));
272
+ return status;
273
+ }
274
+
275
+ return status;
276
+ }
277
+
278
+ #endif /* NC_HAVE_EPOLL */
@@ -20,20 +20,40 @@
20
20
 
21
21
  #include <nc_core.h>
22
22
 
23
- /*
24
- * A hint to the kernel that is used to size the event backing store
25
- * of a given epoll instance
26
- */
27
- #define EVENT_SIZE_HINT 1024
23
+ #define NC_EVENT_SIZE 1024
24
+ #define EV_READ 0xff
25
+ #define EV_WRITE 0xff00
26
+ #define EV_ERR 0xff0000
28
27
 
29
- int event_init(struct context *ctx, int size);
30
- void event_deinit(struct context *ctx);
28
+ #ifdef NC_HAVE_KQUEUE
29
+ struct evbase {
30
+ int kq;
31
+ struct kevent *changes; /* list of changes to be made */
32
+ struct kevent *kevents; /* list of events returned from kevent */
33
+ int n_changes; /* number of changes in our list */
34
+ int n_returned; /* number of events returned from kevent */
35
+ int n_processed;
36
+ int nevent;
37
+ void (*callback_fp)(void *, uint32_t);
38
+ };
39
+ #endif
40
+ #ifdef NC_HAVE_EPOLL
41
+ struct evbase {
42
+ int ep;
43
+ int nevent;
44
+ struct epoll_event *event;
45
+ void (*callback_fp)(void *, uint32_t);
46
+ };
47
+ #endif
31
48
 
32
- int event_add_out(int ep, struct conn *c);
33
- int event_del_out(int ep, struct conn *c);
34
- int event_add_conn(int ep, struct conn *c);
35
- int event_del_conn(int ep, struct conn *c);
49
+ struct evbase *evbase_create(int size, void (*callback_fp)(void *, uint32_t));
50
+ void evbase_destroy(struct evbase *evb);
36
51
 
37
- int event_wait(int ep, struct epoll_event *event, int nevent, int timeout);
52
+ int event_add_out(struct evbase *evb, struct conn *c);
53
+ int event_del_out(struct evbase *evb, struct conn *c);
54
+ int event_add_conn(struct evbase *evb, struct conn *c);
55
+ int event_del_conn(struct evbase *evb, struct conn *c);
56
+ int event_wait(struct evbase *evb, int timeout);
57
+ int event_add_st(struct evbase *evb, int fd);
38
58
 
39
- #endif
59
+ #endif /* _NC_EVENT_H */
@@ -0,0 +1,296 @@
1
+ /*
2
+ * twemproxy - A fast and lightweight proxy for memcached protocol.
3
+ * Copyright (C) 2011 Twitter, Inc.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+
18
+
19
+ #include <unistd.h>
20
+ #include <nc_core.h>
21
+ #include <nc_event.h>
22
+
23
+ #ifdef NC_HAVE_KQUEUE
24
+ #include <sys/event.h>
25
+
26
+ struct evbase *
27
+ evbase_create(int nevent, void (*callback_fp)(void *, uint32_t))
28
+ {
29
+
30
+ struct evbase *evb;
31
+ int status, kq;
32
+ struct kevent *changes, *kevents;
33
+
34
+ if (nevent <= 0) {
35
+ log_error("nevent has to be positive %d", nevent);
36
+ return NULL;
37
+ }
38
+
39
+ /* Initialize the kernel queue */
40
+ if ((kq = kqueue()) == -1) {
41
+ log_error("kernel queue create failed: %s", kq, strerror(errno));
42
+ return NULL;
43
+ }
44
+
45
+ changes = nc_calloc(nevent, sizeof(*changes));
46
+ if (changes == NULL) {
47
+ status = close(kq);
48
+ if (status < 0) {
49
+ log_error("close kq %d failed, ignored: %s", kq, strerror(errno));
50
+ }
51
+ return NULL;
52
+ }
53
+
54
+ kevents = nc_calloc(nevent, sizeof(*kevents));
55
+ if (kevents == NULL) {
56
+ nc_free(changes);
57
+ status = close(kq);
58
+ if (status < 0) {
59
+ log_error("close kq %d failed, ignored: %s", kq, strerror(errno));
60
+ }
61
+ return NULL;
62
+ }
63
+
64
+ evb = (struct evbase *) nc_alloc(sizeof(*evb));
65
+ if (evb == NULL) {
66
+ nc_free(changes);
67
+ nc_free(kevents);
68
+ status = close(kq);
69
+ if (status < 0) {
70
+ log_error("close kq %d failed, ignored: %s", kq, strerror(errno));
71
+ }
72
+ return NULL;
73
+ }
74
+
75
+ evb->kq = kq;
76
+ evb->changes = changes;
77
+ evb->kevents = kevents;
78
+ evb->nevent = nevent;
79
+ evb->callback_fp = callback_fp;
80
+ evb->n_changes = 0;
81
+
82
+ log_debug(LOG_INFO, "kq %d with nevent %d", evb->kq,
83
+ evb->nevent);
84
+
85
+ return evb;
86
+ }
87
+
88
+ void
89
+ evbase_destroy(struct evbase *evb)
90
+ {
91
+ int status;
92
+
93
+ if (evb == NULL) return;
94
+
95
+ ASSERT(evb->kq >= 0);
96
+
97
+ nc_free(evb->changes);
98
+ nc_free(evb->kevents);
99
+
100
+ status = close(evb->kq);
101
+ if (status < 0) {
102
+ log_error("close kq %d failed, ignored: %s", evb->kq, strerror(errno));
103
+ }
104
+ nc_free(evb);
105
+ }
106
+
107
+ int
108
+ event_add_out(struct evbase *evb, struct conn *c)
109
+ {
110
+ struct kevent *event;
111
+ int kq = evb->kq;
112
+
113
+ ASSERT(kq > 0);
114
+ ASSERT(c != NULL);
115
+ ASSERT(c->sd > 0);
116
+ ASSERT(c->recv_active);
117
+ ASSERT(evb->n_changes < evb->nevent);
118
+
119
+ if (c->send_active) {
120
+ return 0;
121
+ }
122
+
123
+ event = &evb->changes[(evb->n_changes)++];
124
+ EV_SET(event, c->sd, EVFILT_WRITE, EV_ADD | EV_CLEAR, 0, 0, (void *)c);
125
+
126
+ c->send_active = 1;
127
+
128
+ return 0;
129
+ }
130
+
131
+ int
132
+ event_del_out(struct evbase *evb, struct conn *c)
133
+ {
134
+ struct kevent *event;
135
+ int kq = evb->kq;
136
+
137
+ ASSERT(kq > 0);
138
+ ASSERT(c != NULL);
139
+ ASSERT(c->sd > 0);
140
+ ASSERT(c->recv_active);
141
+ ASSERT(evb->n_changes < evb->nevent);
142
+
143
+ if (!c->send_active) {
144
+ return 0;
145
+ }
146
+
147
+ event = &evb->changes[(evb->n_changes)++];
148
+ EV_SET(event, c->sd, EVFILT_WRITE, EV_DELETE, 0, 0, (void *)c);
149
+
150
+ c->send_active = 0;
151
+
152
+ return 0;
153
+ }
154
+
155
+ int
156
+ event_add_conn(struct evbase *evb, struct conn *c)
157
+ {
158
+ struct kevent *event;
159
+ int kq = evb->kq;
160
+
161
+ ASSERT(kq > 0);
162
+ ASSERT(c != NULL);
163
+ ASSERT(c->sd > 0);
164
+ ASSERT(evb->n_changes < evb->nevent);
165
+
166
+ event = &evb->changes[(evb->n_changes)++];
167
+ EV_SET(event, c->sd, EVFILT_READ, EV_ADD | EV_CLEAR, 0, 0, (void *)c);
168
+
169
+ c->recv_active = 1;
170
+
171
+ event_add_out(evb, c);
172
+ c->send_active = 1;
173
+
174
+ return 0;
175
+ }
176
+
177
+ int
178
+ event_del_conn(struct evbase *evb, struct conn *c)
179
+ {
180
+ int i;
181
+ struct kevent *event;
182
+ int kq = evb->kq;
183
+
184
+ ASSERT(kq > 0);
185
+ ASSERT(c != NULL);
186
+ ASSERT(c->sd > 0);
187
+ ASSERT(evb->n_changes < evb->nevent);
188
+
189
+ event = &evb->changes[(evb->n_changes)++];
190
+ EV_SET(event, c->sd, EVFILT_READ, EV_DELETE, 0, 0, (void *)c);
191
+
192
+ event_del_out(evb, c);
193
+
194
+ c->recv_active = 0;
195
+ c->send_active = 0;
196
+
197
+ /*
198
+ * Now, eliminate pending events for c->sd (there should be at most one
199
+ * other event). This is important because we will close c->sd and free
200
+ * c when we return.
201
+ */
202
+ for (i = evb->n_processed + 1; i < evb->n_returned; i++) {
203
+ struct kevent *ev = &evb->kevents[i];
204
+ if (ev->ident == (uintptr_t)c->sd) {
205
+ ev->flags = 0;
206
+ ev->filter = 0;
207
+ break;
208
+ }
209
+ }
210
+
211
+ return 0;
212
+ }
213
+
214
+ int
215
+ event_wait(struct evbase *evb, int timeout)
216
+ {
217
+ int kq = evb->kq;
218
+ struct timespec ts = nc_millisec_to_timespec(timeout);
219
+ void (*callback_fp)(void *, uint32_t) = evb->callback_fp;
220
+
221
+ ASSERT(kq > 0);
222
+
223
+ for (;;) {
224
+ evb->n_returned = kevent(kq, evb->changes, evb->n_changes, evb->kevents,
225
+ evb->nevent, &ts);
226
+ evb->n_changes = 0;
227
+ if (evb->n_returned > 0) {
228
+ for (evb->n_processed = 0; evb->n_processed < evb->n_returned;
229
+ evb->n_processed++) {
230
+ struct kevent *ev = &evb->kevents[evb->n_processed];
231
+
232
+ uint32_t evflags = 0;
233
+ if (ev->flags & EV_ERROR) {
234
+ /*
235
+ * Error messages that can happen, when a delete fails.
236
+ * EBADF happens when the file descriptor has been
237
+ * closed,
238
+ * ENOENT when the file descriptor was closed and
239
+ * then reopened.
240
+ * EINVAL for some reasons not understood; EINVAL
241
+ * should not be returned ever; but FreeBSD does :-\
242
+ * An error is also indicated when a callback deletes
243
+ * an event we are still processing. In that case
244
+ * the data field is set to ENOENT.
245
+ */
246
+ if (ev->data == EBADF ||
247
+ ev->data == EINVAL ||
248
+ ev->data == ENOENT)
249
+ continue;
250
+ evflags |= EV_ERR;
251
+ }
252
+
253
+ if (ev->filter == EVFILT_READ)
254
+ evflags |= EV_READ;
255
+
256
+ if (ev->filter == EVFILT_WRITE)
257
+ evflags |= EV_WRITE;
258
+
259
+ if (callback_fp != NULL && evflags != 0)
260
+ (*callback_fp)((void *)(ev->udata), evflags);
261
+ }
262
+ return evb->n_returned;
263
+ }
264
+
265
+ if (evb->n_returned == 0) {
266
+ if (timeout == -1) {
267
+ log_error("kqueue on kq %d with %d events and %d timeout "
268
+ "returned no events", kq, evb->nevent, timeout);
269
+ return -1;
270
+ }
271
+
272
+ return 0;
273
+ }
274
+
275
+ if (errno == EINTR) {
276
+ continue;
277
+ }
278
+
279
+ log_error("kevent on kq %d with %d events failed: %s", kq, evb->nevent,
280
+ strerror(errno));
281
+
282
+ return -1;
283
+ }
284
+ NOT_REACHED();
285
+ }
286
+
287
+ int
288
+ event_add_st(struct evbase *evb, int fd)
289
+ {
290
+ struct kevent *ev = &evb->changes[(evb->n_changes)++];
291
+ EV_SET(ev, fd, EVFILT_READ, EV_ADD | EV_CLEAR, 0, 0, NULL);
292
+
293
+ return 0;
294
+ }
295
+
296
+ #endif /* NC_HAVE_KQUEUE */