Kouhei Sutou
null+****@clear*****
Thu Jul 11 21:34:23 JST 2013
Kouhei Sutou 2013-07-11 21:34:23 +0900 (Thu, 11 Jul 2013) New Revision: 73dca1ff191023a007ab9e52c0d8cde69b3344fb https://github.com/groonga/groonga/commit/73dca1ff191023a007ab9e52c0d8cde69b3344fb Message: suggest: use zmq_compatible.h in suggest_httpd for zmq >= 3 GitHub: refs #63 See also: http://www.zeromq.org/docs:3-1-upgrade Reported by Naoya Inada. Thanks!!! groonga_suggest_httpd.c: In function ‘log_send’: groonga_suggest_httpd.c:215:9: error: too few arguments to function ‘zmq_send’ if (zmq_send(thd->zmq_sock, &msg, 0)) { ^ In file included from groonga_suggest_httpd.c:38:0: /usr/include/zmq.h:349:16: note: declared here ZMQ_EXPORT int zmq_send (void *s, const void *buf, size_t len, int flags); ^ groonga_suggest_httpd.c: In function ‘recv_handler’: groonga_suggest_httpd.c:497:5: error: too few arguments to function ‘zmq_recv’ if (zmq_recv(zmq_recv_sock, &msg, 0)) { ^ In file included from groonga_suggest_httpd.c:38:0: /usr/include/zmq.h:350:16: note: declared here ZMQ_EXPORT int zmq_recv (void *s, void *buf, size_t len, int flags); ^ Modified files: src/suggest/groonga_suggest_httpd.c src/suggest/httpd_sources.am Modified: src/suggest/groonga_suggest_httpd.c (+5 -5) =================================================================== --- src/suggest/groonga_suggest_httpd.c 2013-07-11 21:31:53 +0900 (b856bea) +++ src/suggest/groonga_suggest_httpd.c 2013-07-11 21:34:23 +0900 (0b4197b) @@ -1,5 +1,5 @@ /* -*- c-basic-offset: 2 -*- */ -/* Copyright(C) 2010-2012 Brazil +/* Copyright(C) 2010-2013 Brazil This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -35,7 +35,7 @@ #include <netinet/in.h> #include <sys/resource.h> -#include <zmq.h> +#include "zmq_compatible.h" #include <event.h> #include <evhttp.h> #include <msgpack.h> @@ -212,8 +212,8 @@ log_send(struct evkeyvalq *output_headers, struct evbuffer *res_buf, zmq_msg_t msg; if (!zmq_msg_init_size(&msg, sbuf.size)) { memcpy((void *)zmq_msg_data(&msg), sbuf.data, sbuf.size); - if (zmq_send(thd->zmq_sock, &msg, 0)) { - print_error("zmq_send() error"); + if (zmq_msg_send(&msg, thd->zmq_sock, 0)) { + print_error("zmq_msg_send() error"); } zmq_msg_close(&msg); } @@ -494,7 +494,7 @@ recv_handler(grn_ctx *ctx, void *zmq_recv_sock, msgpack_zone *mempool, grn_obj * if (zmq_msg_init(&msg)) { print_error("cannot init zmq message."); } else { - if (zmq_recv(zmq_recv_sock, &msg, 0)) { + if (zmq_msg_recv(&msg, zmq_recv_sock, 0)) { print_error("cannot recv zmq message."); } else { msgpack_object obj; Modified: src/suggest/httpd_sources.am (+2 -1) =================================================================== --- src/suggest/httpd_sources.am 2013-07-11 21:31:53 +0900 (8f84feb) +++ src/suggest/httpd_sources.am 2013-07-11 21:34:23 +0900 (a09328d) @@ -1,2 +1,3 @@ groonga_suggest_httpd_SOURCES = \ - groonga_suggest_httpd.c + groonga_suggest_httpd.c \ + zmq_compatible.h -------------- next part -------------- HTML����������������������������... 下载