[Groonga-commit] groonga/groonga at a6f6fe7 [master] suggest: support zmq_msg_send() in zmq >= 3

Back to archive index

Kouhei Sutou null+****@clear*****
Thu Jul 11 21:25:06 JST 2013


Kouhei Sutou	2013-07-11 21:25:06 +0900 (Thu, 11 Jul 2013)

  New Revision: a6f6fe73be46b23e0ba3a625c6ab829060769f79
  https://github.com/groonga/groonga/commit/a6f6fe73be46b23e0ba3a625c6ab829060769f79

  Message:
    suggest: support zmq_msg_send() in zmq >= 3
    
    GitHub: refs #63
    
    See also: http://www.zeromq.org/docs:3-1-upgrade
    
    Reported by Naoya Inada. Thanks!!!
    
        groonga_suggest_learner.c: In function ‘zmq_send_to_httpd’:
        groonga_suggest_learner.c:197:5: error: too few arguments to function ‘zmq_send’
             if (zmq_send(zmq_send_sock, &msg, 0)) {
             ^
        In file included from groonga_suggest_learner.c:17: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);
                        ^

  Modified files:
    src/suggest/groonga_suggest_learner.c

  Modified: src/suggest/groonga_suggest_learner.c (+7 -2)
===================================================================
--- src/suggest/groonga_suggest_learner.c    2013-07-06 22:44:33 +0900 (7d5224c)
+++ src/suggest/groonga_suggest_learner.c    2013-07-11 21:25:06 +0900 (90dc4d4)
@@ -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
@@ -30,6 +30,11 @@
 
 #include <evhttp.h>
 
+#if ZMQ_VERSION_MAJOR == 2
+#  define zmq_msg_send(message, socket, flags) \
+  zmq_send((socket), (message), (flags))
+#endif
+
 #define DEFAULT_RECV_ENDPOINT "tcp://*:1234"
 #define DEFAULT_SEND_ENDPOINT "tcp://*:1235"
 #define SEND_WAIT 1000 /* 0.001sec */
@@ -194,7 +199,7 @@ zmq_send_to_httpd(void *zmq_send_sock, void *data, size_t size)
   zmq_msg_t msg;
   if (!zmq_msg_init_size(&msg, size)) {
     memcpy((void *)zmq_msg_data(&msg), data, size);
-    if (zmq_send(zmq_send_sock, &msg, 0)) {
+    if (zmq_msg_send(&msg, zmq_send_sock, 0)) {
       print_error("zmq_send() error");
       return -1;
     }
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Back to archive index