nutcracker 0.2.4.mac9 → 0.2.4.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (296) hide show
  1. data/README.md +13 -46
  2. data/Rakefile +20 -15
  3. data/bin/nutcracker +1 -6
  4. data/ext/nutcracker/ChangeLog +0 -9
  5. data/ext/nutcracker/LICENSE +0 -0
  6. data/ext/nutcracker/Makefile.am +0 -0
  7. data/ext/nutcracker/Makefile.in +149 -66
  8. data/ext/nutcracker/NOTICE +0 -0
  9. data/ext/nutcracker/README.md +11 -13
  10. data/ext/nutcracker/aclocal.m4 +201 -112
  11. data/ext/nutcracker/conf/nutcracker.leaf.yml +0 -0
  12. data/ext/nutcracker/conf/nutcracker.root.yml +0 -0
  13. data/ext/nutcracker/conf/nutcracker.yml +0 -0
  14. data/ext/nutcracker/config.h.in +0 -15
  15. data/ext/nutcracker/config/config.guess +84 -23
  16. data/ext/nutcracker/config/config.sub +93 -23
  17. data/ext/nutcracker/config/depcomp +81 -35
  18. data/ext/nutcracker/config/install-sh +122 -109
  19. data/ext/nutcracker/config/ltmain.sh +721 -1053
  20. data/ext/nutcracker/config/missing +29 -20
  21. data/ext/nutcracker/configure +2311 -2113
  22. data/ext/nutcracker/configure.ac +3 -35
  23. data/ext/nutcracker/contrib/Makefile.am +0 -0
  24. data/ext/nutcracker/contrib/Makefile.in +107 -41
  25. data/ext/nutcracker/contrib/yaml-0.1.4.tar.gz +0 -0
  26. data/ext/nutcracker/extconf.rb +5 -3
  27. data/ext/nutcracker/m4/libtool.m4 +492 -553
  28. data/ext/nutcracker/m4/ltoptions.m4 +6 -7
  29. data/ext/nutcracker/m4/ltversion.m4 +5 -5
  30. data/ext/nutcracker/m4/lt~obsolete.m4 +3 -9
  31. data/ext/nutcracker/notes/c-styleguide.txt +0 -0
  32. data/ext/nutcracker/notes/debug.txt +0 -0
  33. data/ext/nutcracker/notes/memcache.txt +0 -0
  34. data/ext/nutcracker/notes/recommendation.md +2 -21
  35. data/ext/nutcracker/notes/redis.md +9 -9
  36. data/ext/nutcracker/notes/socket.txt +0 -0
  37. data/ext/nutcracker/scripts/nutcracker.init +0 -0
  38. data/ext/nutcracker/scripts/nutcracker.spec +0 -0
  39. data/ext/nutcracker/scripts/redis-check.py +0 -0
  40. data/ext/nutcracker/scripts/redis-check.sh +0 -9
  41. data/ext/nutcracker/src/Makefile.am +1 -1
  42. data/ext/nutcracker/src/Makefile.in +153 -74
  43. data/ext/nutcracker/src/hashkit/Makefile.am +0 -1
  44. data/ext/nutcracker/src/hashkit/Makefile.in +64 -39
  45. data/ext/nutcracker/src/hashkit/nc_crc32.c +0 -0
  46. data/ext/nutcracker/src/hashkit/nc_fnv.c +0 -0
  47. data/ext/nutcracker/src/hashkit/nc_hashkit.h +0 -2
  48. data/ext/nutcracker/src/hashkit/nc_hsieh.c +0 -0
  49. data/ext/nutcracker/src/hashkit/nc_jenkins.c +0 -0
  50. data/ext/nutcracker/src/hashkit/nc_ketama.c +0 -0
  51. data/ext/nutcracker/src/hashkit/nc_md5.c +0 -0
  52. data/ext/nutcracker/src/hashkit/nc_modula.c +6 -18
  53. data/ext/nutcracker/src/hashkit/nc_murmur.c +0 -0
  54. data/ext/nutcracker/src/hashkit/nc_one_at_a_time.c +0 -0
  55. data/ext/nutcracker/src/hashkit/nc_random.c +0 -0
  56. data/ext/nutcracker/src/nc.c +0 -0
  57. data/ext/nutcracker/src/nc_array.c +0 -0
  58. data/ext/nutcracker/src/nc_array.h +0 -0
  59. data/ext/nutcracker/src/nc_client.c +0 -0
  60. data/ext/nutcracker/src/nc_client.h +0 -0
  61. data/ext/nutcracker/src/nc_conf.c +35 -14
  62. data/ext/nutcracker/src/nc_conf.h +1 -1
  63. data/ext/nutcracker/src/nc_connection.c +0 -0
  64. data/ext/nutcracker/src/nc_connection.h +0 -0
  65. data/ext/nutcracker/src/nc_core.c +26 -29
  66. data/ext/nutcracker/src/nc_core.h +5 -13
  67. data/ext/nutcracker/src/{nc_epoll.c → nc_event.c} +30 -94
  68. data/ext/nutcracker/src/nc_event.h +13 -33
  69. data/ext/nutcracker/src/nc_log.c +0 -0
  70. data/ext/nutcracker/src/nc_log.h +0 -0
  71. data/ext/nutcracker/src/nc_mbuf.c +0 -0
  72. data/ext/nutcracker/src/nc_mbuf.h +0 -0
  73. data/ext/nutcracker/src/nc_message.c +0 -0
  74. data/ext/nutcracker/src/nc_message.h +0 -2
  75. data/ext/nutcracker/src/nc_proxy.c +8 -8
  76. data/ext/nutcracker/src/nc_proxy.h +0 -0
  77. data/ext/nutcracker/src/nc_queue.h +0 -0
  78. data/ext/nutcracker/src/nc_rbtree.c +0 -0
  79. data/ext/nutcracker/src/nc_rbtree.h +0 -0
  80. data/ext/nutcracker/src/nc_request.c +3 -3
  81. data/ext/nutcracker/src/nc_response.c +6 -4
  82. data/ext/nutcracker/src/nc_server.c +12 -14
  83. data/ext/nutcracker/src/nc_server.h +0 -0
  84. data/ext/nutcracker/src/nc_signal.c +0 -0
  85. data/ext/nutcracker/src/nc_signal.h +0 -0
  86. data/ext/nutcracker/src/nc_stats.c +21 -16
  87. data/ext/nutcracker/src/nc_stats.h +4 -3
  88. data/ext/nutcracker/src/nc_string.c +0 -0
  89. data/ext/nutcracker/src/nc_string.h +0 -0
  90. data/ext/nutcracker/src/nc_util.c +0 -16
  91. data/ext/nutcracker/src/nc_util.h +0 -1
  92. data/ext/nutcracker/src/proto/Makefile.am +0 -0
  93. data/ext/nutcracker/src/proto/Makefile.in +60 -32
  94. data/ext/nutcracker/src/proto/nc_memcache.c +0 -0
  95. data/ext/nutcracker/src/proto/nc_proto.h +0 -0
  96. data/ext/nutcracker/src/proto/nc_redis.c +4 -17
  97. data/lib/nutcracker.rb +2 -187
  98. data/lib/nutcracker/version.rb +1 -1
  99. metadata +10 -256
  100. data/ext/nutcracker/Makefile +0 -643
  101. data/ext/nutcracker/autom4te.cache/output.0 +0 -18664
  102. data/ext/nutcracker/autom4te.cache/output.1 +0 -18664
  103. data/ext/nutcracker/autom4te.cache/output.2 +0 -18664
  104. data/ext/nutcracker/autom4te.cache/requests +0 -494
  105. data/ext/nutcracker/autom4te.cache/traces.0 +0 -2415
  106. data/ext/nutcracker/autom4te.cache/traces.1 +0 -945
  107. data/ext/nutcracker/autom4te.cache/traces.2 +0 -2415
  108. data/ext/nutcracker/config.h +0 -332
  109. data/ext/nutcracker/config.log +0 -2684
  110. data/ext/nutcracker/config.status +0 -2317
  111. data/ext/nutcracker/contrib/Makefile +0 -494
  112. data/ext/nutcracker/contrib/yaml-0.1.4/Makefile +0 -736
  113. data/ext/nutcracker/contrib/yaml-0.1.4/autom4te.cache/output.0 +0 -13102
  114. data/ext/nutcracker/contrib/yaml-0.1.4/autom4te.cache/output.1 +0 -13085
  115. data/ext/nutcracker/contrib/yaml-0.1.4/autom4te.cache/output.2 +0 -13085
  116. data/ext/nutcracker/contrib/yaml-0.1.4/autom4te.cache/requests +0 -476
  117. data/ext/nutcracker/contrib/yaml-0.1.4/autom4te.cache/traces.0 +0 -2339
  118. data/ext/nutcracker/contrib/yaml-0.1.4/autom4te.cache/traces.1 +0 -545
  119. data/ext/nutcracker/contrib/yaml-0.1.4/autom4te.cache/traces.2 +0 -2339
  120. data/ext/nutcracker/contrib/yaml-0.1.4/config.h +0 -81
  121. data/ext/nutcracker/contrib/yaml-0.1.4/config.h.in~ +0 -80
  122. data/ext/nutcracker/contrib/yaml-0.1.4/config.log +0 -688
  123. data/ext/nutcracker/contrib/yaml-0.1.4/config.status +0 -2032
  124. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/annotated.html +0 -51
  125. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/bc_s.png +0 -0
  126. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/classes.html +0 -41
  127. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/closed.png +0 -0
  128. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/doxygen.css +0 -656
  129. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/doxygen.png +0 -0
  130. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/files.html +0 -40
  131. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions.html +0 -91
  132. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_0x62.html +0 -84
  133. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_0x63.html +0 -87
  134. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_0x64.html +0 -83
  135. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_0x65.html +0 -110
  136. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_0x66.html +0 -79
  137. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_0x68.html +0 -80
  138. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_0x69.html +0 -92
  139. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_0x6b.html +0 -71
  140. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_0x6c.html +0 -88
  141. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_0x6d.html +0 -96
  142. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_0x6e.html +0 -71
  143. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_0x6f.html +0 -80
  144. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_0x70.html +0 -100
  145. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_0x71.html +0 -71
  146. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_0x72.html +0 -87
  147. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_0x73.html +0 -163
  148. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_0x74.html +0 -115
  149. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_0x75.html +0 -71
  150. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_0x76.html +0 -80
  151. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_0x77.html +0 -77
  152. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_vars.html +0 -91
  153. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_vars_0x62.html +0 -84
  154. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_vars_0x63.html +0 -87
  155. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_vars_0x64.html +0 -83
  156. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_vars_0x65.html +0 -110
  157. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_vars_0x66.html +0 -79
  158. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_vars_0x68.html +0 -80
  159. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_vars_0x69.html +0 -92
  160. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_vars_0x6b.html +0 -71
  161. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_vars_0x6c.html +0 -88
  162. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_vars_0x6d.html +0 -96
  163. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_vars_0x6e.html +0 -71
  164. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_vars_0x6f.html +0 -80
  165. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_vars_0x70.html +0 -100
  166. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_vars_0x71.html +0 -71
  167. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_vars_0x72.html +0 -87
  168. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_vars_0x73.html +0 -163
  169. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_vars_0x74.html +0 -115
  170. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_vars_0x75.html +0 -71
  171. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_vars_0x76.html +0 -80
  172. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_vars_0x77.html +0 -77
  173. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/globals.html +0 -667
  174. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/globals_defs.html +0 -81
  175. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/globals_enum.html +0 -78
  176. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/globals_eval.html +0 -373
  177. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/globals_func.html +0 -196
  178. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/globals_type.html +0 -126
  179. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/group__basic.html +0 -320
  180. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/group__emitter.html +0 -819
  181. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/group__events.html +0 -664
  182. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/group__export.html +0 -60
  183. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/group__nodes.html +0 -795
  184. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/group__parser.html +0 -606
  185. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/group__styles.html +0 -222
  186. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/group__tokens.html +0 -246
  187. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/group__version.html +0 -106
  188. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/index.html +0 -31
  189. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/modules.html +0 -42
  190. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/nav_f.png +0 -0
  191. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/nav_h.png +0 -0
  192. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/open.png +0 -0
  193. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/structyaml__alias__data__s.html +0 -108
  194. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/structyaml__document__s.html +0 -235
  195. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/structyaml__emitter__s.html +0 -1300
  196. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/structyaml__event__s.html +0 -496
  197. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/structyaml__mark__s.html +0 -108
  198. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/structyaml__node__pair__s.html +0 -91
  199. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/structyaml__node__s.html +0 -420
  200. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/structyaml__parser__s.html +0 -1229
  201. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/structyaml__simple__key__s.html +0 -97
  202. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/structyaml__tag__directive__s.html +0 -91
  203. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/structyaml__token__s.html +0 -413
  204. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/structyaml__version__directive__s.html +0 -91
  205. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/tab_a.png +0 -0
  206. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/tab_b.png +0 -0
  207. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/tab_h.png +0 -0
  208. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/tab_s.png +0 -0
  209. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/tabs.css +0 -59
  210. data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/yaml_8h.html +0 -525
  211. data/ext/nutcracker/contrib/yaml-0.1.4/include/Makefile.am +0 -17
  212. data/ext/nutcracker/contrib/yaml-0.1.4/include/Makefile.in +0 -470
  213. data/ext/nutcracker/contrib/yaml-0.1.4/libtool +0 -8890
  214. data/ext/nutcracker/contrib/yaml-0.1.4/src/Makefile +0 -484
  215. data/ext/nutcracker/contrib/yaml-0.1.4/src/api.lo +0 -12
  216. data/ext/nutcracker/contrib/yaml-0.1.4/src/api.o +0 -0
  217. data/ext/nutcracker/contrib/yaml-0.1.4/src/dumper.lo +0 -12
  218. data/ext/nutcracker/contrib/yaml-0.1.4/src/dumper.o +0 -0
  219. data/ext/nutcracker/contrib/yaml-0.1.4/src/emitter.lo +0 -12
  220. data/ext/nutcracker/contrib/yaml-0.1.4/src/emitter.o +0 -0
  221. data/ext/nutcracker/contrib/yaml-0.1.4/src/libyaml.la +0 -41
  222. data/ext/nutcracker/contrib/yaml-0.1.4/src/loader.lo +0 -12
  223. data/ext/nutcracker/contrib/yaml-0.1.4/src/loader.o +0 -0
  224. data/ext/nutcracker/contrib/yaml-0.1.4/src/parser.lo +0 -12
  225. data/ext/nutcracker/contrib/yaml-0.1.4/src/parser.o +0 -0
  226. data/ext/nutcracker/contrib/yaml-0.1.4/src/reader.lo +0 -12
  227. data/ext/nutcracker/contrib/yaml-0.1.4/src/reader.o +0 -0
  228. data/ext/nutcracker/contrib/yaml-0.1.4/src/scanner.lo +0 -12
  229. data/ext/nutcracker/contrib/yaml-0.1.4/src/scanner.o +0 -0
  230. data/ext/nutcracker/contrib/yaml-0.1.4/src/writer.lo +0 -12
  231. data/ext/nutcracker/contrib/yaml-0.1.4/src/writer.o +0 -0
  232. data/ext/nutcracker/contrib/yaml-0.1.4/stamp-h1 +0 -1
  233. data/ext/nutcracker/contrib/yaml-0.1.4/tests/Makefile +0 -675
  234. data/ext/nutcracker/contrib/yaml-0.1.4/tests/example-deconstructor +0 -0
  235. data/ext/nutcracker/contrib/yaml-0.1.4/tests/example-deconstructor-alt +0 -0
  236. data/ext/nutcracker/contrib/yaml-0.1.4/tests/example-deconstructor-alt.o +0 -0
  237. data/ext/nutcracker/contrib/yaml-0.1.4/tests/example-deconstructor.o +0 -0
  238. data/ext/nutcracker/contrib/yaml-0.1.4/tests/example-reformatter +0 -0
  239. data/ext/nutcracker/contrib/yaml-0.1.4/tests/example-reformatter-alt +0 -0
  240. data/ext/nutcracker/contrib/yaml-0.1.4/tests/example-reformatter-alt.o +0 -0
  241. data/ext/nutcracker/contrib/yaml-0.1.4/tests/example-reformatter.o +0 -0
  242. data/ext/nutcracker/contrib/yaml-0.1.4/tests/run-dumper +0 -0
  243. data/ext/nutcracker/contrib/yaml-0.1.4/tests/run-dumper.o +0 -0
  244. data/ext/nutcracker/contrib/yaml-0.1.4/tests/run-emitter +0 -0
  245. data/ext/nutcracker/contrib/yaml-0.1.4/tests/run-emitter.o +0 -0
  246. data/ext/nutcracker/contrib/yaml-0.1.4/tests/run-loader +0 -0
  247. data/ext/nutcracker/contrib/yaml-0.1.4/tests/run-loader.o +0 -0
  248. data/ext/nutcracker/contrib/yaml-0.1.4/tests/run-parser +0 -0
  249. data/ext/nutcracker/contrib/yaml-0.1.4/tests/run-parser.o +0 -0
  250. data/ext/nutcracker/contrib/yaml-0.1.4/tests/run-scanner +0 -0
  251. data/ext/nutcracker/contrib/yaml-0.1.4/tests/run-scanner.o +0 -0
  252. data/ext/nutcracker/contrib/yaml-0.1.4/yaml-0.1.pc +0 -10
  253. data/ext/nutcracker/contrib/yaml-0.1.4/yaml-0.1.pc.in +0 -10
  254. data/ext/nutcracker/libtool +0 -9403
  255. data/ext/nutcracker/src/Makefile +0 -647
  256. data/ext/nutcracker/src/hashkit/Makefile +0 -476
  257. data/ext/nutcracker/src/hashkit/libhashkit.a +0 -0
  258. data/ext/nutcracker/src/hashkit/nc_crc16.c +0 -66
  259. data/ext/nutcracker/src/hashkit/nc_crc16.o +0 -0
  260. data/ext/nutcracker/src/hashkit/nc_crc32.o +0 -0
  261. data/ext/nutcracker/src/hashkit/nc_fnv.o +0 -0
  262. data/ext/nutcracker/src/hashkit/nc_hsieh.o +0 -0
  263. data/ext/nutcracker/src/hashkit/nc_jenkins.o +0 -0
  264. data/ext/nutcracker/src/hashkit/nc_ketama.o +0 -0
  265. data/ext/nutcracker/src/hashkit/nc_md5.o +0 -0
  266. data/ext/nutcracker/src/hashkit/nc_modula.o +0 -0
  267. data/ext/nutcracker/src/hashkit/nc_murmur.o +0 -0
  268. data/ext/nutcracker/src/hashkit/nc_one_at_a_time.o +0 -0
  269. data/ext/nutcracker/src/hashkit/nc_random.o +0 -0
  270. data/ext/nutcracker/src/nc.o +0 -0
  271. data/ext/nutcracker/src/nc_array.o +0 -0
  272. data/ext/nutcracker/src/nc_client.o +0 -0
  273. data/ext/nutcracker/src/nc_conf.o +0 -0
  274. data/ext/nutcracker/src/nc_connection.o +0 -0
  275. data/ext/nutcracker/src/nc_core.o +0 -0
  276. data/ext/nutcracker/src/nc_epoll.o +0 -0
  277. data/ext/nutcracker/src/nc_kqueue.c +0 -296
  278. data/ext/nutcracker/src/nc_kqueue.o +0 -0
  279. data/ext/nutcracker/src/nc_log.o +0 -0
  280. data/ext/nutcracker/src/nc_mbuf.o +0 -0
  281. data/ext/nutcracker/src/nc_message.o +0 -0
  282. data/ext/nutcracker/src/nc_proxy.o +0 -0
  283. data/ext/nutcracker/src/nc_rbtree.o +0 -0
  284. data/ext/nutcracker/src/nc_request.o +0 -0
  285. data/ext/nutcracker/src/nc_response.o +0 -0
  286. data/ext/nutcracker/src/nc_server.o +0 -0
  287. data/ext/nutcracker/src/nc_signal.o +0 -0
  288. data/ext/nutcracker/src/nc_stats.o +0 -0
  289. data/ext/nutcracker/src/nc_string.o +0 -0
  290. data/ext/nutcracker/src/nc_util.o +0 -0
  291. data/ext/nutcracker/src/nutcracker +0 -0
  292. data/ext/nutcracker/src/proto/Makefile +0 -454
  293. data/ext/nutcracker/src/proto/libproto.a +0 -0
  294. data/ext/nutcracker/src/proto/nc_memcache.o +0 -0
  295. data/ext/nutcracker/src/proto/nc_redis.o +0 -0
  296. data/ext/nutcracker/stamp-h1 +0 -1
@@ -120,7 +120,7 @@ char *conf_set_string(struct conf *cf, struct command *cmd, void *conf);
120
120
  char *conf_set_listen(struct conf *cf, struct command *cmd, void *conf);
121
121
  char *conf_add_server(struct conf *cf, struct command *cmd, void *conf);
122
122
  char *conf_set_num(struct conf *cf, struct command *cmd, void *conf);
123
- char *conf_set_bool(struct conf *cf, struct command *cmd, void *conf);
123
+ char * conf_set_bool(struct conf *cf, struct command *cmd, void *conf);
124
124
  char *conf_set_hash(struct conf *cf, struct command *cmd, void *conf);
125
125
  char *conf_set_distribution(struct conf *cf, struct command *cmd, void *conf);
126
126
  char *conf_set_hashtag(struct conf *cf, struct command *cmd, void *conf);
File without changes
File without changes
@@ -17,6 +17,9 @@
17
17
 
18
18
  #include <stdlib.h>
19
19
  #include <unistd.h>
20
+
21
+ #include <sys/epoll.h>
22
+
20
23
  #include <nc_core.h>
21
24
  #include <nc_event.h>
22
25
  #include <nc_conf.h>
@@ -25,10 +28,6 @@
25
28
 
26
29
  static uint32_t ctx_id; /* context generation */
27
30
 
28
- /* function prototype for use in core_ctx_create() */
29
- static void
30
- core_core(void *arg, uint32_t evflags);
31
-
32
31
  static struct context *
33
32
  core_ctx_create(struct instance *nci)
34
33
  {
@@ -42,10 +41,12 @@ core_ctx_create(struct instance *nci)
42
41
  ctx->id = ++ctx_id;
43
42
  ctx->cf = NULL;
44
43
  ctx->stats = NULL;
45
- ctx->evb = NULL;
46
44
  array_null(&ctx->pool);
45
+ ctx->ep = -1;
46
+ ctx->nevent = EVENT_SIZE_HINT;
47
47
  ctx->max_timeout = nci->stats_interval;
48
48
  ctx->timeout = ctx->max_timeout;
49
+ ctx->event = NULL;
49
50
 
50
51
  /* parse and create configuration */
51
52
  ctx->cf = conf_create(nci->conf_filename);
@@ -73,8 +74,8 @@ core_ctx_create(struct instance *nci)
73
74
  }
74
75
 
75
76
  /* initialize event handling for client, proxy and server */
76
- ctx->evb = evbase_create(NC_EVENT_SIZE, &core_core);
77
- if (ctx->evb == NULL) {
77
+ status = event_init(ctx, EVENT_SIZE_HINT);
78
+ if (status != NC_OK) {
78
79
  stats_destroy(ctx->stats);
79
80
  server_pool_deinit(&ctx->pool);
80
81
  conf_destroy(ctx->cf);
@@ -86,7 +87,7 @@ core_ctx_create(struct instance *nci)
86
87
  status = server_pool_preconnect(ctx);
87
88
  if (status != NC_OK) {
88
89
  server_pool_disconnect(ctx);
89
- evbase_destroy(ctx->evb);
90
+ event_deinit(ctx);
90
91
  stats_destroy(ctx->stats);
91
92
  server_pool_deinit(&ctx->pool);
92
93
  conf_destroy(ctx->cf);
@@ -98,7 +99,7 @@ core_ctx_create(struct instance *nci)
98
99
  status = proxy_init(ctx);
99
100
  if (status != NC_OK) {
100
101
  server_pool_disconnect(ctx);
101
- evbase_destroy(ctx->evb);
102
+ event_deinit(ctx);
102
103
  stats_destroy(ctx->stats);
103
104
  server_pool_deinit(&ctx->pool);
104
105
  conf_destroy(ctx->cf);
@@ -117,7 +118,7 @@ core_ctx_destroy(struct context *ctx)
117
118
  log_debug(LOG_VVERB, "destroy ctx %p id %"PRIu32"", ctx, ctx->id);
118
119
  proxy_deinit(ctx);
119
120
  server_pool_disconnect(ctx);
120
- evbase_destroy(ctx->evb);
121
+ event_deinit(ctx);
121
122
  stats_destroy(ctx->stats);
122
123
  server_pool_deinit(&ctx->pool);
123
124
  conf_destroy(ctx->cf);
@@ -205,9 +206,9 @@ core_close(struct context *ctx, struct conn *conn)
205
206
  conn->eof, conn->done, conn->recv_bytes, conn->send_bytes,
206
207
  conn->err ? ':' : ' ', conn->err ? strerror(conn->err) : "");
207
208
 
208
- status = event_del_conn(ctx->evb, conn);
209
+ status = event_del_conn(ctx->ep, conn);
209
210
  if (status < 0) {
210
- log_warn("event del conn %c %d failed, ignored: %s",
211
+ log_warn("event del conn e %d %c %d failed, ignored: %s", ctx->ep,
211
212
  type, conn->sd, strerror(errno));
212
213
  }
213
214
 
@@ -276,33 +277,23 @@ core_timeout(struct context *ctx)
276
277
  }
277
278
 
278
279
  static void
279
- core_core(void *arg, uint32_t evflags)
280
+ core_core(struct context *ctx, struct conn *conn, uint32_t events)
280
281
  {
281
282
  rstatus_t status;
282
- struct conn *conn = (struct conn *) arg;
283
- struct context *ctx;
284
283
 
285
-
286
-
287
- if ((conn->proxy) || (conn->client)) {
288
- ctx = ((struct server_pool *) (conn -> owner)) -> ctx;
289
- } else {
290
- ctx = ((struct server_pool *) (((struct server *) (conn -> owner)) -> owner )) -> ctx;
291
- }
292
-
293
- log_debug(LOG_VVERB, "event %04"PRIX32" on %c %d", evflags,
284
+ log_debug(LOG_VVERB, "event %04"PRIX32" on %c %d", events,
294
285
  conn->client ? 'c' : (conn->proxy ? 'p' : 's'), conn->sd);
295
286
 
296
- conn->events = evflags;
287
+ conn->events = events;
297
288
 
298
289
  /* error takes precedence over read | write */
299
- if (evflags & EV_ERR) {
290
+ if (events & EPOLLERR) {
300
291
  core_error(ctx, conn);
301
292
  return;
302
293
  }
303
294
 
304
295
  /* read takes precedence over write */
305
- if (evflags & EV_READ) {
296
+ if (events & (EPOLLIN | EPOLLHUP)) {
306
297
  status = core_recv(ctx, conn);
307
298
  if (status != NC_OK || conn->done || conn->err) {
308
299
  core_close(ctx, conn);
@@ -310,7 +301,7 @@ core_core(void *arg, uint32_t evflags)
310
301
  }
311
302
  }
312
303
 
313
- if (evflags & EV_WRITE) {
304
+ if (events & EPOLLOUT) {
314
305
  status = core_send(ctx, conn);
315
306
  if (status != NC_OK || conn->done || conn->err) {
316
307
  core_close(ctx, conn);
@@ -324,11 +315,17 @@ core_loop(struct context *ctx)
324
315
  {
325
316
  int i, nsd;
326
317
 
327
- nsd = event_wait(ctx->evb, ctx->timeout);
318
+ nsd = event_wait(ctx->ep, ctx->event, ctx->nevent, ctx->timeout);
328
319
  if (nsd < 0) {
329
320
  return nsd;
330
321
  }
331
322
 
323
+ for (i = 0; i < nsd; i++) {
324
+ struct epoll_event *ev = &ctx->event[i];
325
+
326
+ core_core(ctx, ev->data.ptr, ev->events);
327
+ }
328
+
332
329
  core_timeout(ctx);
333
330
 
334
331
  stats_swap(ctx->stats);
@@ -40,20 +40,10 @@
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
-
49
43
  #ifdef HAVE_LITTLE_ENDIAN
50
44
  # define NC_LITTLE_ENDIAN 1
51
45
  #endif
52
46
 
53
- #ifdef HAVE_BACKTRACE
54
- #define NC_HAVE_BACKTRACE 1
55
- #endif
56
-
57
47
  #define NC_OK 0
58
48
  #define NC_ERROR -1
59
49
  #define NC_EAGAIN -2
@@ -111,12 +101,14 @@ struct context {
111
101
  struct stats *stats; /* stats */
112
102
 
113
103
  struct array pool; /* server_pool[] */
114
- struct evbase *evb;
104
+
105
+ int ep; /* epoll device */
106
+ int nevent; /* # epoll event */
115
107
  int max_timeout; /* epoll wait max timeout in msec */
116
- int timeout;
108
+ int timeout; /* epoll wait timeout in msec */
109
+ struct epoll_event *event; /* epoll event */
117
110
  };
118
111
 
119
-
120
112
  struct instance {
121
113
  struct context *ctx; /* active context */
122
114
  int log_level; /* log level */
@@ -16,86 +16,66 @@
16
16
  */
17
17
 
18
18
  #include <unistd.h>
19
+ #include <sys/epoll.h>
20
+
19
21
  #include <nc_core.h>
20
22
  #include <nc_event.h>
21
23
 
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))
24
+ int
25
+ event_init(struct context *ctx, int size)
27
26
  {
28
-
29
- struct evbase *evb;
30
27
  int status, ep;
31
28
  struct epoll_event *event;
32
29
 
33
- if (nevent <= 0) {
34
- log_error("nevent has to be positive %d", nevent);
35
- return NULL;
36
- }
30
+ ASSERT(ctx->ep < 0);
31
+ ASSERT(ctx->nevent != 0);
32
+ ASSERT(ctx->event == NULL);
37
33
 
38
- ep = epoll_create(nevent);
34
+ ep = epoll_create(size);
39
35
  if (ep < 0) {
40
- log_error("epoll create of size %d failed: %s", nevent, strerror(errno));
41
- return NULL;
36
+ log_error("epoll create of size %d failed: %s", size, strerror(errno));
37
+ return -1;
42
38
  }
43
39
 
44
- event = nc_calloc(nevent, sizeof(*event));
40
+ event = nc_calloc(ctx->nevent, sizeof(*ctx->event));
45
41
  if (event == NULL) {
46
42
  status = close(ep);
47
43
  if (status < 0) {
48
44
  log_error("close e %d failed, ignored: %s", ep, strerror(errno));
49
45
  }
50
- return NULL;
51
- }
52
-
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;
61
-
46
+ return -1;
62
47
  }
63
48
 
64
- evb->nevent = nevent;
65
- evb->ep = ep;
66
- evb->event = event;
67
- evb->callback_fp = callback_fp;
49
+ ctx->ep = ep;
50
+ ctx->event = event;
68
51
 
69
- log_debug(LOG_INFO, "e %d with nevent %d", evb->ep,
70
- evb->nevent);
52
+ log_debug(LOG_INFO, "e %d with nevent %d timeout %d", ctx->ep,
53
+ ctx->nevent, ctx->timeout);
71
54
 
72
- return evb;
55
+ return 0;
73
56
  }
74
57
 
75
58
  void
76
- evbase_destroy(struct evbase *evb)
59
+ event_deinit(struct context *ctx)
77
60
  {
78
61
  int status;
79
62
 
80
- if (evb == NULL) return;
63
+ ASSERT(ctx->ep >= 0);
81
64
 
82
- ASSERT(evb->ep >= 0);
65
+ nc_free(ctx->event);
83
66
 
84
- nc_free(evb->event);
85
-
86
- status = close(evb->ep);
67
+ status = close(ctx->ep);
87
68
  if (status < 0) {
88
- log_error("close e %d failed, ignored: %s", evb->ep, strerror(errno));
69
+ log_error("close e %d failed, ignored: %s", ctx->ep, strerror(errno));
89
70
  }
90
- nc_free(evb);
71
+ ctx->ep = -1;
91
72
  }
92
73
 
93
74
  int
94
- event_add_out(struct evbase *evb, struct conn *c)
75
+ event_add_out(int ep, struct conn *c)
95
76
  {
96
77
  int status;
97
78
  struct epoll_event event;
98
- int ep = evb->ep;
99
79
 
100
80
  ASSERT(ep > 0);
101
81
  ASSERT(c != NULL);
@@ -121,11 +101,10 @@ event_add_out(struct evbase *evb, struct conn *c)
121
101
  }
122
102
 
123
103
  int
124
- event_del_out(struct evbase *evb, struct conn *c)
104
+ event_del_out(int ep, struct conn *c)
125
105
  {
126
106
  int status;
127
107
  struct epoll_event event;
128
- int ep = evb->ep;
129
108
 
130
109
  ASSERT(ep > 0);
131
110
  ASSERT(c != NULL);
@@ -151,11 +130,10 @@ event_del_out(struct evbase *evb, struct conn *c)
151
130
  }
152
131
 
153
132
  int
154
- event_add_conn(struct evbase *evb, struct conn *c)
133
+ event_add_conn(int ep, struct conn *c)
155
134
  {
156
135
  int status;
157
136
  struct epoll_event event;
158
- int ep = evb->ep;
159
137
 
160
138
  ASSERT(ep > 0);
161
139
  ASSERT(c != NULL);
@@ -177,10 +155,9 @@ event_add_conn(struct evbase *evb, struct conn *c)
177
155
  }
178
156
 
179
157
  int
180
- event_del_conn(struct evbase *evb, struct conn *c)
158
+ event_del_conn(int ep, struct conn *c)
181
159
  {
182
160
  int status;
183
- int ep = evb->ep;
184
161
 
185
162
  ASSERT(ep > 0);
186
163
  ASSERT(c != NULL);
@@ -199,14 +176,9 @@ event_del_conn(struct evbase *evb, struct conn *c)
199
176
  }
200
177
 
201
178
  int
202
- event_wait(struct evbase *evb, int timeout)
179
+ event_wait(int ep, struct epoll_event *event, int nevent, int timeout)
203
180
  {
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;
181
+ int nsd;
210
182
 
211
183
  ASSERT(ep > 0);
212
184
  ASSERT(event != NULL);
@@ -215,22 +187,6 @@ event_wait(struct evbase *evb, int timeout)
215
187
  for (;;) {
216
188
  nsd = epoll_wait(ep, event, nevent, timeout);
217
189
  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
- }
234
190
  return nsd;
235
191
  }
236
192
 
@@ -253,26 +209,6 @@ event_wait(struct evbase *evb, int timeout)
253
209
 
254
210
  return -1;
255
211
  }
256
- NOT_REACHED();
257
- }
258
212
 
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;
213
+ NOT_REACHED();
276
214
  }
277
-
278
- #endif /* NC_HAVE_EPOLL */
@@ -20,40 +20,20 @@
20
20
 
21
21
  #include <nc_core.h>
22
22
 
23
- #define NC_EVENT_SIZE 1024
24
- #define EV_READ 0xff
25
- #define EV_WRITE 0xff00
26
- #define EV_ERR 0xff0000
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
27
28
 
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
29
+ int event_init(struct context *ctx, int size);
30
+ void event_deinit(struct context *ctx);
48
31
 
49
- struct evbase *evbase_create(int size, void (*callback_fp)(void *, uint32_t));
50
- void evbase_destroy(struct evbase *evb);
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);
51
36
 
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);
37
+ int event_wait(int ep, struct epoll_event *event, int nevent, int timeout);
58
38
 
59
- #endif /* _NC_EVENT_H */
39
+ #endif