summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTony Garnock-Jones <tonygarnockjones@gmail.com>2010-01-09 00:19:39 +0000
committerTony Garnock-Jones <tonygarnockjones@gmail.com>2010-01-09 00:19:39 +0000
commitf51e24634a82b43d30f3b489c2e878ea8e49d649 (patch)
tree25f99f9ff2d8e9b8ace8687084a82f20f46e68b4
parent4df56e951a2310edf825ec79fb007e16d0f2c2a3 (diff)
parentfcb2456751ecedea8c50ca8e7d6560e49e352903 (diff)
downloadrabbitmq-c-github-ask-f51e24634a82b43d30f3b489c2e878ea8e49d649.tar.gz
Merge default into amqp_0_9_1
-rw-r--r--configure.ac2
-rw-r--r--examples/amqp_consumer.c2
-rw-r--r--examples/amqp_listen.c2
-rw-r--r--examples/amqp_listenq.c2
-rw-r--r--librabbitmq/amqp.h3
-rw-r--r--librabbitmq/amqp_api.c5
-rw-r--r--librabbitmq/amqp_socket.c11
-rw-r--r--librabbitmq/codegen.py1
8 files changed, 19 insertions, 9 deletions
diff --git a/configure.ac b/configure.ac
index 2a3d0c0..8279ca7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -29,7 +29,7 @@ AC_ARG_ENABLE(64-bit,
AC_MSG_CHECKING(location of AMQP codegen directory)
sibling_codegen_dir="$ac_abs_confdir/../rabbitmq-codegen"
AMQP_CODEGEN_DIR=$(test -d "$sibling_codegen_dir" && echo "$sibling_codegen_dir" || echo "$ac_abs_confdir/codegen")
-AMQP_SPEC_JSON_PATH="$AMQP_CODEGEN_DIR/amqp-0.8.json"
+AMQP_SPEC_JSON_PATH="$AMQP_CODEGEN_DIR/amqp-0.9.1.json"
if test -f "$AMQP_SPEC_JSON_PATH"
then
AC_MSG_RESULT($AMQP_CODEGEN_DIR)
diff --git a/examples/amqp_consumer.c b/examples/amqp_consumer.c
index 230a94e..b91ec16 100644
--- a/examples/amqp_consumer.c
+++ b/examples/amqp_consumer.c
@@ -123,7 +123,7 @@ int main(int argc, char const * const *argv) {
AMQP_EMPTY_TABLE);
die_on_amqp_error(amqp_rpc_reply, "Binding queue");
- amqp_basic_consume(conn, 1, queuename, AMQP_EMPTY_BYTES, 0, 1, 0);
+ amqp_basic_consume(conn, 1, queuename, AMQP_EMPTY_BYTES, 0, 1, 0, AMQP_EMPTY_TABLE);
die_on_amqp_error(amqp_rpc_reply, "Consuming");
run(conn);
diff --git a/examples/amqp_listen.c b/examples/amqp_listen.c
index d39e4b4..3f52da4 100644
--- a/examples/amqp_listen.c
+++ b/examples/amqp_listen.c
@@ -59,7 +59,7 @@ int main(int argc, char const * const *argv) {
AMQP_EMPTY_TABLE);
die_on_amqp_error(amqp_rpc_reply, "Binding queue");
- amqp_basic_consume(conn, 1, queuename, AMQP_EMPTY_BYTES, 0, 1, 0);
+ amqp_basic_consume(conn, 1, queuename, AMQP_EMPTY_BYTES, 0, 1, 0, AMQP_EMPTY_TABLE);
die_on_amqp_error(amqp_rpc_reply, "Consuming");
{
diff --git a/examples/amqp_listenq.c b/examples/amqp_listenq.c
index b6d37fc..958a063 100644
--- a/examples/amqp_listenq.c
+++ b/examples/amqp_listenq.c
@@ -41,7 +41,7 @@ int main(int argc, char const * const *argv) {
amqp_channel_open(conn, 1);
die_on_amqp_error(amqp_rpc_reply, "Opening channel");
- amqp_basic_consume(conn, 1, amqp_cstring_bytes(queuename), AMQP_EMPTY_BYTES, 0, 0, 0);
+ amqp_basic_consume(conn, 1, amqp_cstring_bytes(queuename), AMQP_EMPTY_BYTES, 0, 0, 0, AMQP_EMPTY_TABLE);
die_on_amqp_error(amqp_rpc_reply, "Consuming");
{
diff --git a/librabbitmq/amqp.h b/librabbitmq/amqp.h
index 45e4d63..c849e23 100644
--- a/librabbitmq/amqp.h
+++ b/librabbitmq/amqp.h
@@ -395,7 +395,8 @@ extern struct amqp_basic_consume_ok_t_ *amqp_basic_consume(amqp_connection_state
amqp_bytes_t consumer_tag,
amqp_boolean_t no_local,
amqp_boolean_t no_ack,
- amqp_boolean_t exclusive);
+ amqp_boolean_t exclusive,
+ amqp_table_t filter);
extern int amqp_basic_ack(amqp_connection_state_t state,
amqp_channel_t channel,
diff --git a/librabbitmq/amqp_api.c b/librabbitmq/amqp_api.c
index 4bd035d..8adf3f0 100644
--- a/librabbitmq/amqp_api.c
+++ b/librabbitmq/amqp_api.c
@@ -175,12 +175,13 @@ amqp_basic_consume_ok_t *amqp_basic_consume(amqp_connection_state_t state,
amqp_bytes_t consumer_tag,
amqp_boolean_t no_local,
amqp_boolean_t no_ack,
- amqp_boolean_t exclusive)
+ amqp_boolean_t exclusive,
+ amqp_table_t filter)
{
amqp_rpc_reply =
AMQP_SIMPLE_RPC(state, channel, BASIC, CONSUME, CONSUME_OK,
amqp_basic_consume_t,
- 0, queue, consumer_tag, no_local, no_ack, exclusive, 0);
+ 0, queue, consumer_tag, no_local, no_ack, exclusive, 0, filter);
return RPC_REPLY(amqp_basic_consume_ok_t);
}
diff --git a/librabbitmq/amqp_socket.c b/librabbitmq/amqp_socket.c
index 0149e7c..c6412a9 100644
--- a/librabbitmq/amqp_socket.c
+++ b/librabbitmq/amqp_socket.c
@@ -50,10 +50,17 @@ static char *header() {
header[1] = 'M';
header[2] = 'Q';
header[3] = 'P';
+#ifndef USE_MODERN_AMQP_PROTOCOL_HEADER
header[4] = 1;
header[5] = 1;
header[6] = AMQP_PROTOCOL_VERSION_MAJOR;
header[7] = AMQP_PROTOCOL_VERSION_MINOR;
+#else
+ header[4] = 0;
+ header[5] = AMQP_PROTOCOL_VERSION_MAJOR;
+ header[6] = AMQP_PROTOCOL_VERSION_MINOR;
+ header[7] = AMQP_PROTOCOL_VERSION_REVISION;
+#endif
return header;
}
@@ -388,8 +395,8 @@ amqp_rpc_reply_t amqp_login(amqp_connection_state_t state,
amqp_connection_open_t s =
(amqp_connection_open_t) {
.virtual_host = amqp_cstring_bytes(vhost),
- .capabilities = {.len = 0, .bytes = NULL},
- .insist = 1
+ .deprecated_capabilities = {.len = 0, .bytes = NULL},
+ .deprecated_insist = 1
};
amqp_method_number_t replies[] = { AMQP_CONNECTION_OPEN_OK_METHOD, 0 };
result = amqp_simple_rpc(state,
diff --git a/librabbitmq/codegen.py b/librabbitmq/codegen.py
index 2c8012c..2ff06fd 100644
--- a/librabbitmq/codegen.py
+++ b/librabbitmq/codegen.py
@@ -392,6 +392,7 @@ extern "C" {
"""
print "#define AMQP_PROTOCOL_VERSION_MAJOR %d" % (spec.major)
print "#define AMQP_PROTOCOL_VERSION_MINOR %d" % (spec.minor)
+ print "#define AMQP_PROTOCOL_VERSION_REVISION %d" % (spec.revision)
print "#define AMQP_PROTOCOL_PORT %d" % (spec.port)
for (c,v,cls) in spec.constants: