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.
- data/README.md +1 -1
- data/ext/nutcracker/ChangeLog +0 -0
- data/ext/nutcracker/LICENSE +0 -0
- data/ext/nutcracker/Makefile +643 -0
- data/ext/nutcracker/Makefile.am +0 -0
- data/ext/nutcracker/Makefile.in +82 -190
- data/ext/nutcracker/NOTICE +0 -0
- data/ext/nutcracker/README.md +0 -0
- data/ext/nutcracker/aclocal.m4 +122 -231
- data/ext/nutcracker/autom4te.cache/output.0 +18664 -0
- data/ext/nutcracker/autom4te.cache/output.1 +18664 -0
- data/ext/nutcracker/autom4te.cache/output.2 +18664 -0
- data/ext/nutcracker/autom4te.cache/requests +494 -0
- data/ext/nutcracker/autom4te.cache/traces.0 +2415 -0
- data/ext/nutcracker/autom4te.cache/traces.1 +945 -0
- data/ext/nutcracker/autom4te.cache/traces.2 +2415 -0
- data/ext/nutcracker/conf/nutcracker.leaf.yml +0 -0
- data/ext/nutcracker/conf/nutcracker.root.yml +0 -0
- data/ext/nutcracker/conf/nutcracker.yml +0 -0
- data/ext/nutcracker/config.h +332 -0
- data/ext/nutcracker/config.h.in +15 -0
- data/ext/nutcracker/config.log +2684 -0
- data/ext/nutcracker/config.status +2317 -0
- data/ext/nutcracker/config/config.guess +248 -278
- data/ext/nutcracker/config/config.sub +77 -234
- data/ext/nutcracker/config/depcomp +39 -143
- data/ext/nutcracker/config/install-sh +116 -136
- data/ext/nutcracker/config/ltmain.sh +788 -1704
- data/ext/nutcracker/config/missing +65 -29
- data/ext/nutcracker/configure +1068 -2014
- data/ext/nutcracker/configure.ac +34 -2
- data/ext/nutcracker/contrib/Makefile +494 -0
- data/ext/nutcracker/contrib/Makefile.am +0 -0
- data/ext/nutcracker/contrib/Makefile.in +47 -120
- data/ext/nutcracker/contrib/yaml-0.1.4.tar.gz +0 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/Makefile +736 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/autom4te.cache/output.0 +13102 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/autom4te.cache/output.1 +13085 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/autom4te.cache/output.2 +13085 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/autom4te.cache/requests +476 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/autom4te.cache/traces.0 +2339 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/autom4te.cache/traces.1 +545 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/autom4te.cache/traces.2 +2339 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/config.h +81 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/config.h.in~ +80 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/config.log +688 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/config.status +2032 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/annotated.html +51 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/bc_s.png +0 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/classes.html +41 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/closed.png +0 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/doxygen.css +656 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/doxygen.png +0 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/files.html +40 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions.html +91 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_0x62.html +84 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_0x63.html +87 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_0x64.html +83 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_0x65.html +110 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_0x66.html +79 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_0x68.html +80 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_0x69.html +92 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_0x6b.html +71 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_0x6c.html +88 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_0x6d.html +96 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_0x6e.html +71 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_0x6f.html +80 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_0x70.html +100 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_0x71.html +71 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_0x72.html +87 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_0x73.html +163 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_0x74.html +115 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_0x75.html +71 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_0x76.html +80 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_0x77.html +77 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_vars.html +91 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_vars_0x62.html +84 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_vars_0x63.html +87 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_vars_0x64.html +83 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_vars_0x65.html +110 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_vars_0x66.html +79 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_vars_0x68.html +80 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_vars_0x69.html +92 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_vars_0x6b.html +71 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_vars_0x6c.html +88 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_vars_0x6d.html +96 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_vars_0x6e.html +71 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_vars_0x6f.html +80 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_vars_0x70.html +100 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_vars_0x71.html +71 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_vars_0x72.html +87 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_vars_0x73.html +163 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_vars_0x74.html +115 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_vars_0x75.html +71 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_vars_0x76.html +80 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/functions_vars_0x77.html +77 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/globals.html +667 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/globals_defs.html +81 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/globals_enum.html +78 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/globals_eval.html +373 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/globals_func.html +196 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/globals_type.html +126 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/group__basic.html +320 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/group__emitter.html +819 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/group__events.html +664 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/group__export.html +60 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/group__nodes.html +795 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/group__parser.html +606 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/group__styles.html +222 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/group__tokens.html +246 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/group__version.html +106 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/index.html +31 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/modules.html +42 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/nav_f.png +0 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/nav_h.png +0 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/open.png +0 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/structyaml__alias__data__s.html +108 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/structyaml__document__s.html +235 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/structyaml__emitter__s.html +1300 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/structyaml__event__s.html +496 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/structyaml__mark__s.html +108 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/structyaml__node__pair__s.html +91 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/structyaml__node__s.html +420 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/structyaml__parser__s.html +1229 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/structyaml__simple__key__s.html +97 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/structyaml__tag__directive__s.html +91 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/structyaml__token__s.html +413 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/structyaml__version__directive__s.html +91 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/tab_a.png +0 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/tab_b.png +0 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/tab_h.png +0 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/tab_s.png +0 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/tabs.css +59 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/doc/html/yaml_8h.html +525 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/include/Makefile.am +17 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/include/Makefile.in +470 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/libtool +8890 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/src/Makefile +484 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/src/api.lo +12 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/src/api.o +0 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/src/dumper.lo +12 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/src/dumper.o +0 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/src/emitter.lo +12 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/src/emitter.o +0 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/src/libyaml.la +41 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/src/loader.lo +12 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/src/loader.o +0 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/src/parser.lo +12 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/src/parser.o +0 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/src/reader.lo +12 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/src/reader.o +0 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/src/scanner.lo +12 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/src/scanner.o +0 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/src/writer.lo +12 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/src/writer.o +0 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/stamp-h1 +1 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/tests/Makefile +675 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/tests/example-deconstructor +0 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/tests/example-deconstructor-alt +0 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/tests/example-deconstructor-alt.o +0 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/tests/example-deconstructor.o +0 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/tests/example-reformatter +0 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/tests/example-reformatter-alt +0 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/tests/example-reformatter-alt.o +0 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/tests/example-reformatter.o +0 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/tests/run-dumper +0 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/tests/run-dumper.o +0 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/tests/run-emitter +0 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/tests/run-emitter.o +0 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/tests/run-loader +0 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/tests/run-loader.o +0 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/tests/run-parser +0 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/tests/run-parser.o +0 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/tests/run-scanner +0 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/tests/run-scanner.o +0 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/yaml-0.1.pc +10 -0
- data/ext/nutcracker/contrib/yaml-0.1.4/yaml-0.1.pc.in +10 -0
- data/ext/nutcracker/exconf.rb +0 -0
- data/ext/nutcracker/extconf.rb +2 -5
- data/ext/nutcracker/libtool +9403 -0
- data/ext/nutcracker/m4/libtool.m4 +396 -960
- data/ext/nutcracker/m4/ltoptions.m4 +2 -17
- data/ext/nutcracker/m4/ltversion.m4 +6 -6
- data/ext/nutcracker/notes/c-styleguide.txt +0 -0
- data/ext/nutcracker/notes/debug.txt +0 -0
- data/ext/nutcracker/notes/memcache.txt +0 -0
- data/ext/nutcracker/notes/recommendation.md +0 -0
- data/ext/nutcracker/notes/redis.md +0 -0
- data/ext/nutcracker/notes/socket.txt +0 -0
- data/ext/nutcracker/scripts/nutcracker.init +0 -0
- data/ext/nutcracker/scripts/nutcracker.spec +0 -0
- data/ext/nutcracker/scripts/redis-check.py +0 -0
- data/ext/nutcracker/src/Makefile +647 -0
- data/ext/nutcracker/src/Makefile.am +1 -1
- data/ext/nutcracker/src/Makefile.in +81 -167
- data/ext/nutcracker/src/hashkit/Makefile +476 -0
- data/ext/nutcracker/src/hashkit/Makefile.am +0 -0
- data/ext/nutcracker/src/hashkit/Makefile.in +37 -72
- data/ext/nutcracker/src/hashkit/libhashkit.a +0 -0
- data/ext/nutcracker/src/hashkit/nc_crc16.c +0 -0
- data/ext/nutcracker/src/hashkit/nc_crc16.o +0 -0
- data/ext/nutcracker/src/hashkit/nc_crc32.c +0 -0
- data/ext/nutcracker/src/hashkit/nc_crc32.o +0 -0
- data/ext/nutcracker/src/hashkit/nc_fnv.c +0 -0
- data/ext/nutcracker/src/hashkit/nc_fnv.o +0 -0
- data/ext/nutcracker/src/hashkit/nc_hashkit.h +0 -0
- data/ext/nutcracker/src/hashkit/nc_hsieh.c +0 -0
- data/ext/nutcracker/src/hashkit/nc_hsieh.o +0 -0
- data/ext/nutcracker/src/hashkit/nc_jenkins.c +0 -0
- data/ext/nutcracker/src/hashkit/nc_jenkins.o +0 -0
- data/ext/nutcracker/src/hashkit/nc_ketama.c +0 -0
- data/ext/nutcracker/src/hashkit/nc_ketama.o +0 -0
- data/ext/nutcracker/src/hashkit/nc_md5.c +0 -0
- data/ext/nutcracker/src/hashkit/nc_md5.o +0 -0
- data/ext/nutcracker/src/hashkit/nc_modula.c +0 -0
- data/ext/nutcracker/src/hashkit/nc_modula.o +0 -0
- data/ext/nutcracker/src/hashkit/nc_murmur.c +0 -0
- data/ext/nutcracker/src/hashkit/nc_murmur.o +0 -0
- data/ext/nutcracker/src/hashkit/nc_one_at_a_time.c +0 -0
- data/ext/nutcracker/src/hashkit/nc_one_at_a_time.o +0 -0
- data/ext/nutcracker/src/hashkit/nc_random.c +0 -0
- data/ext/nutcracker/src/hashkit/nc_random.o +0 -0
- data/ext/nutcracker/src/nc.c +0 -0
- data/ext/nutcracker/src/nc.o +0 -0
- data/ext/nutcracker/src/nc_array.c +0 -0
- data/ext/nutcracker/src/nc_array.h +0 -0
- data/ext/nutcracker/src/nc_array.o +0 -0
- data/ext/nutcracker/src/nc_client.c +0 -0
- data/ext/nutcracker/src/nc_client.h +0 -0
- data/ext/nutcracker/src/nc_client.o +0 -0
- data/ext/nutcracker/src/nc_conf.c +0 -0
- data/ext/nutcracker/src/nc_conf.h +0 -0
- data/ext/nutcracker/src/nc_conf.o +0 -0
- data/ext/nutcracker/src/nc_connection.c +0 -0
- data/ext/nutcracker/src/nc_connection.h +0 -0
- data/ext/nutcracker/src/nc_connection.o +0 -0
- data/ext/nutcracker/src/nc_core.c +29 -26
- data/ext/nutcracker/src/nc_core.h +13 -5
- data/ext/nutcracker/src/nc_core.o +0 -0
- data/ext/nutcracker/src/{nc_event.c → nc_epoll.c} +94 -30
- data/ext/nutcracker/src/nc_epoll.o +0 -0
- data/ext/nutcracker/src/nc_event.h +33 -13
- data/ext/nutcracker/src/nc_kqueue.c +296 -0
- data/ext/nutcracker/src/nc_kqueue.o +0 -0
- data/ext/nutcracker/src/nc_log.c +0 -0
- data/ext/nutcracker/src/nc_log.h +0 -0
- data/ext/nutcracker/src/nc_log.o +0 -0
- data/ext/nutcracker/src/nc_mbuf.c +0 -0
- data/ext/nutcracker/src/nc_mbuf.h +0 -0
- data/ext/nutcracker/src/nc_mbuf.o +0 -0
- data/ext/nutcracker/src/nc_message.c +0 -0
- data/ext/nutcracker/src/nc_message.h +0 -0
- data/ext/nutcracker/src/nc_message.o +0 -0
- data/ext/nutcracker/src/nc_proxy.c +8 -8
- data/ext/nutcracker/src/nc_proxy.h +0 -0
- data/ext/nutcracker/src/nc_proxy.o +0 -0
- data/ext/nutcracker/src/nc_queue.h +0 -0
- data/ext/nutcracker/src/nc_rbtree.c +0 -0
- data/ext/nutcracker/src/nc_rbtree.h +0 -0
- data/ext/nutcracker/src/nc_rbtree.o +0 -0
- data/ext/nutcracker/src/nc_request.c +3 -3
- data/ext/nutcracker/src/nc_request.o +0 -0
- data/ext/nutcracker/src/nc_response.c +4 -6
- data/ext/nutcracker/src/nc_response.o +0 -0
- data/ext/nutcracker/src/nc_server.c +5 -5
- data/ext/nutcracker/src/nc_server.h +0 -0
- data/ext/nutcracker/src/nc_server.o +0 -0
- data/ext/nutcracker/src/nc_signal.c +0 -0
- data/ext/nutcracker/src/nc_signal.h +0 -0
- data/ext/nutcracker/src/nc_signal.o +0 -0
- data/ext/nutcracker/src/nc_stats.c +16 -21
- data/ext/nutcracker/src/nc_stats.h +3 -4
- data/ext/nutcracker/src/nc_stats.o +0 -0
- data/ext/nutcracker/src/nc_string.c +0 -0
- data/ext/nutcracker/src/nc_string.h +0 -0
- data/ext/nutcracker/src/nc_string.o +0 -0
- data/ext/nutcracker/src/nc_util.c +16 -0
- data/ext/nutcracker/src/nc_util.h +1 -0
- data/ext/nutcracker/src/nc_util.o +0 -0
- data/ext/nutcracker/src/nutcracker +0 -0
- data/ext/nutcracker/src/proto/Makefile +454 -0
- data/ext/nutcracker/src/proto/Makefile.am +0 -0
- data/ext/nutcracker/src/proto/Makefile.in +37 -72
- data/ext/nutcracker/src/proto/libproto.a +0 -0
- data/ext/nutcracker/src/proto/nc_memcache.c +0 -0
- data/ext/nutcracker/src/proto/nc_memcache.o +0 -0
- data/ext/nutcracker/src/proto/nc_proto.h +0 -0
- data/ext/nutcracker/src/proto/nc_redis.c +0 -0
- data/ext/nutcracker/src/proto/nc_redis.o +0 -0
- data/ext/nutcracker/stamp-h1 +1 -0
- data/lib/nutcracker.rb +95 -4
- data/lib/nutcracker/version.rb +1 -1
- 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;
|
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 */
|
Binary file
|
@@ -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
|
-
|
25
|
-
|
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
|
-
|
31
|
-
|
32
|
-
|
33
|
+
if (nevent <= 0) {
|
34
|
+
log_error("nevent has to be positive %d", nevent);
|
35
|
+
return NULL;
|
36
|
+
}
|
33
37
|
|
34
|
-
ep = epoll_create(
|
38
|
+
ep = epoll_create(nevent);
|
35
39
|
if (ep < 0) {
|
36
|
-
log_error("epoll create of size %d failed: %s",
|
37
|
-
return
|
40
|
+
log_error("epoll create of size %d failed: %s", nevent, strerror(errno));
|
41
|
+
return NULL;
|
38
42
|
}
|
39
43
|
|
40
|
-
event = nc_calloc(
|
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
|
50
|
+
return NULL;
|
47
51
|
}
|
48
52
|
|
49
|
-
|
50
|
-
|
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
|
-
|
53
|
-
ctx->nevent, ctx->timeout);
|
62
|
+
}
|
54
63
|
|
55
|
-
|
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
|
-
|
76
|
+
evbase_destroy(struct evbase *evb)
|
60
77
|
{
|
61
78
|
int status;
|
62
79
|
|
63
|
-
|
80
|
+
if (evb == NULL) return;
|
64
81
|
|
65
|
-
|
82
|
+
ASSERT(evb->ep >= 0);
|
66
83
|
|
67
|
-
|
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",
|
88
|
+
log_error("close e %d failed, ignored: %s", evb->ep, strerror(errno));
|
70
89
|
}
|
71
|
-
|
90
|
+
nc_free(evb);
|
72
91
|
}
|
73
92
|
|
74
93
|
int
|
75
|
-
event_add_out(
|
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(
|
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(
|
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(
|
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(
|
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 */
|
Binary file
|
@@ -20,20 +20,40 @@
|
|
20
20
|
|
21
21
|
#include <nc_core.h>
|
22
22
|
|
23
|
-
|
24
|
-
|
25
|
-
|
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
|
-
|
30
|
-
|
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
|
-
|
33
|
-
|
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
|
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 */
|