Skip to content

Commit 57beee4

Browse files
committed
Merge default into amqp_0_9_1
2 parents 83b5975 + 5606e1d commit 57beee4

File tree

9 files changed

+20
-10
lines changed

9 files changed

+20
-10
lines changed

configure.ac

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ AC_ARG_ENABLE(64-bit,
3030
AC_MSG_CHECKING(location of AMQP codegen directory)
3131
sibling_codegen_dir="$ac_abs_confdir/../rabbitmq-codegen"
3232
AMQP_CODEGEN_DIR=$(test -d "$sibling_codegen_dir" && echo "$sibling_codegen_dir" || echo "$ac_abs_confdir/codegen")
33-
AMQP_SPEC_JSON_PATH="$AMQP_CODEGEN_DIR/amqp-0.8.json"
33+
AMQP_SPEC_JSON_PATH="$AMQP_CODEGEN_DIR/amqp-0.9.1.json"
3434
if test -f "$AMQP_SPEC_JSON_PATH"
3535
then
3636
AC_MSG_RESULT($AMQP_CODEGEN_DIR)

examples/amqp_consumer.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ int main(int argc, char const * const *argv) {
173173
AMQP_EMPTY_TABLE);
174174
die_on_amqp_error(amqp_get_rpc_reply(conn), "Binding queue");
175175

176-
amqp_basic_consume(conn, 1, queuename, AMQP_EMPTY_BYTES, 0, 1, 0);
176+
amqp_basic_consume(conn, 1, queuename, AMQP_EMPTY_BYTES, 0, 1, 0, AMQP_EMPTY_TABLE);
177177
die_on_amqp_error(amqp_get_rpc_reply(conn), "Consuming");
178178

179179
run(conn);

examples/amqp_listen.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ int main(int argc, char const * const *argv) {
109109
AMQP_EMPTY_TABLE);
110110
die_on_amqp_error(amqp_get_rpc_reply(conn), "Binding queue");
111111

112-
amqp_basic_consume(conn, 1, queuename, AMQP_EMPTY_BYTES, 0, 1, 0);
112+
amqp_basic_consume(conn, 1, queuename, AMQP_EMPTY_BYTES, 0, 1, 0, AMQP_EMPTY_TABLE);
113113
die_on_amqp_error(amqp_get_rpc_reply(conn), "Consuming");
114114

115115
{

examples/amqp_listenq.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ int main(int argc, char const * const *argv) {
9191
amqp_channel_open(conn, 1);
9292
die_on_amqp_error(amqp_get_rpc_reply(conn), "Opening channel");
9393

94-
amqp_basic_consume(conn, 1, amqp_cstring_bytes(queuename), AMQP_EMPTY_BYTES, 0, 0, 0);
94+
amqp_basic_consume(conn, 1, amqp_cstring_bytes(queuename), AMQP_EMPTY_BYTES, 0, 0, 0, AMQP_EMPTY_TABLE);
9595
die_on_amqp_error(amqp_get_rpc_reply(conn), "Consuming");
9696

9797
{

librabbitmq/amqp.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,8 @@ extern struct amqp_basic_consume_ok_t_ *amqp_basic_consume(amqp_connection_state
444444
amqp_bytes_t consumer_tag,
445445
amqp_boolean_t no_local,
446446
amqp_boolean_t no_ack,
447-
amqp_boolean_t exclusive);
447+
amqp_boolean_t exclusive,
448+
amqp_table_t filter);
448449

449450
extern int amqp_basic_ack(amqp_connection_state_t state,
450451
amqp_channel_t channel,

librabbitmq/amqp_api.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -223,12 +223,13 @@ amqp_basic_consume_ok_t *amqp_basic_consume(amqp_connection_state_t state,
223223
amqp_bytes_t consumer_tag,
224224
amqp_boolean_t no_local,
225225
amqp_boolean_t no_ack,
226-
amqp_boolean_t exclusive)
226+
amqp_boolean_t exclusive,
227+
amqp_table_t filter)
227228
{
228229
state->most_recent_api_result =
229230
AMQP_SIMPLE_RPC(state, channel, BASIC, CONSUME, CONSUME_OK,
230231
amqp_basic_consume_t,
231-
0, queue, consumer_tag, no_local, no_ack, exclusive, 0);
232+
0, queue, consumer_tag, no_local, no_ack, exclusive, 0, filter);
232233
return RPC_REPLY(amqp_basic_consume_ok_t);
233234
}
234235

librabbitmq/amqp_socket.c

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,10 +100,17 @@ static char *header() {
100100
header[1] = 'M';
101101
header[2] = 'Q';
102102
header[3] = 'P';
103+
#ifndef USE_MODERN_AMQP_PROTOCOL_HEADER
103104
header[4] = 1;
104105
header[5] = 1;
105106
header[6] = AMQP_PROTOCOL_VERSION_MAJOR;
106107
header[7] = AMQP_PROTOCOL_VERSION_MINOR;
108+
#else
109+
header[4] = 0;
110+
header[5] = AMQP_PROTOCOL_VERSION_MAJOR;
111+
header[6] = AMQP_PROTOCOL_VERSION_MINOR;
112+
header[7] = AMQP_PROTOCOL_VERSION_REVISION;
113+
#endif
107114
return header;
108115
}
109116

@@ -446,8 +453,8 @@ amqp_rpc_reply_t amqp_login(amqp_connection_state_t state,
446453
amqp_connection_open_t s =
447454
(amqp_connection_open_t) {
448455
.virtual_host = amqp_cstring_bytes(vhost),
449-
.capabilities = {.len = 0, .bytes = NULL},
450-
.insist = 1
456+
.deprecated_capabilities = {.len = 0, .bytes = NULL},
457+
.deprecated_insist = 1
451458
};
452459
amqp_method_number_t replies[] = { AMQP_CONNECTION_OPEN_OK_METHOD, 0 };
453460
result = amqp_simple_rpc(state,

librabbitmq/codegen.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -412,6 +412,7 @@ def propDeclList(fields):
412412
"""
413413
print "#define AMQP_PROTOCOL_VERSION_MAJOR %d" % (spec.major)
414414
print "#define AMQP_PROTOCOL_VERSION_MINOR %d" % (spec.minor)
415+
print "#define AMQP_PROTOCOL_VERSION_REVISION %d" % (spec.revision)
415416
print "#define AMQP_PROTOCOL_PORT %d" % (spec.port)
416417

417418
for (c,v,cls) in spec.constants:

tools/consume.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ static void do_consume(amqp_connection_state_t conn, int no_ack,
6161
const char * const *argv)
6262
{
6363
if (!amqp_basic_consume(conn, 1, setup_queue(conn),
64-
AMQP_EMPTY_BYTES, 0, no_ack, 0))
64+
AMQP_EMPTY_BYTES, 0, no_ack, 0, AMQP_EMPTY_TABLE))
6565
die_rpc(amqp_get_rpc_reply(conn), "basic.consume");
6666

6767
for (;;) {

0 commit comments

Comments
 (0)