From a78aa8ab906c97dc3f4123048519a2953fa96fb2 Mon Sep 17 00:00:00 2001 From: Alan Antonuk Date: Mon, 17 Feb 2014 19:01:00 -0800 Subject: Use poll(2) for timeouts on socket Use poll(2) instead of select(2) to do timeout operations on sockets. This helps with the situation where the fd is larger than FD_MAXSIZE. Fixes #168 --- librabbitmq/amqp_socket.c | 47 +++++++++++++++++++++++++++++++---------------- librabbitmq/amqp_timer.h | 5 ++++- 2 files changed, 35 insertions(+), 17 deletions(-) diff --git a/librabbitmq/amqp_socket.c b/librabbitmq/amqp_socket.c index 79a7696..6e54f7e 100644 --- a/librabbitmq/amqp_socket.c +++ b/librabbitmq/amqp_socket.c @@ -42,6 +42,7 @@ #include "amqp_timer.h" #include +#include #include #include #include @@ -64,9 +65,14 @@ # include # include # include +# include # include #endif +#ifdef _WIN32 +# define poll(fdarray, nfds, timeout) WSAPoll(fdarray, nfds, timeout) +#endif + static int amqp_os_socket_init(void) { @@ -275,7 +281,9 @@ int amqp_open_socket_noblock(char const *hostname, AMQP_INIT_TIMER(timer) - if (timeout && (timeout->tv_sec < 0 || timeout->tv_usec < 0)) { + if (timeout && (timeout->tv_sec < 0 || timeout->tv_usec < 0 || + INT_MAX < ((uint64_t)timeout->tv_sec * AMQP_MS_PER_S + + (uint64_t)timeout->tv_usec / AMQP_US_PER_MS))) { return AMQP_STATUS_INVALID_PARAMETER; } @@ -349,14 +357,12 @@ int amqp_open_socket_noblock(char const *hostname, #endif while(1) { - fd_set write_fd; - fd_set except_fd; + struct pollfd pfd; + int timeout_ms; - FD_ZERO(&write_fd); - FD_SET(sockfd, &write_fd); - - FD_ZERO(&except_fd); - FD_SET(sockfd, &except_fd); + pfd.fd = sockfd; + pfd.events = POLLERR | POLLOUT; + pfd.revents = 0; timer_error = amqp_timer_update(&timer, timeout); @@ -365,11 +371,13 @@ int amqp_open_socket_noblock(char const *hostname, break; } + timeout_ms = timer.tv.tv_sec * AMQP_MS_PER_S + + timer.tv.tv_usec / AMQP_US_PER_MS; /* Win32 requires except_fds to be passed to detect connection * failure. Other platforms only need write_fds, passing except_fds * seems to be harmless otherwise */ - res = select(sockfd+1, NULL, &write_fd, &except_fd, &timer.tv); + res = poll(&pfd, 1, timeout_ms); if (res > 0) { int result; @@ -547,22 +555,29 @@ static int recv_with_timeout(amqp_connection_state_t state, uint64_t start, stru if (timeout) { int fd; - fd_set read_fd; - fd_set except_fd; fd = amqp_get_sockfd(state); if (-1 == fd) { return AMQP_STATUS_CONNECTION_CLOSED; } + if (INT_MAX < (uint64_t)timeout->tv_sec * AMQP_MS_PER_S + + (uint64_t)timeout->tv_usec / AMQP_US_PER_MS) { + return AMQP_STATUS_INVALID_PARAMETER; + } + while (1) { - FD_ZERO(&read_fd); - FD_SET(fd, &read_fd); + struct pollfd pfd; + int timeout_ms; + + pfd.fd = fd; + pfd.events = POLLIN; + pfd.revents = 0; - FD_ZERO(&except_fd); - FD_SET(fd, &except_fd); + timeout_ms = timeout->tv_sec * AMQP_MS_PER_S + + timeout->tv_usec * AMQP_US_PER_MS; - res = select(fd + 1, &read_fd, NULL, &except_fd, timeout); + res = poll(&pfd, 1, timeout_ms); if (0 < res) { break; diff --git a/librabbitmq/amqp_timer.h b/librabbitmq/amqp_timer.h index 8ac3de9..10254a5 100644 --- a/librabbitmq/amqp_timer.h +++ b/librabbitmq/amqp_timer.h @@ -37,7 +37,10 @@ # include #endif -#define AMQP_NS_PER_S 1000000000 +#define AMQP_MS_PER_S 1000 +#define AMQP_US_PER_MS 1000 +#define AMQP_NS_PER_S 1000000000 +#define AMQP_NS_PER_MS 1000000 #define AMQP_NS_PER_US 1000 #define AMQP_INIT_TIMER(structure) { \ -- cgit v1.2.1 From 932de5ff045353ed7ca83810fe088a0f58cf1d33 Mon Sep 17 00:00:00 2001 From: jestor Date: Thu, 8 May 2014 14:32:35 +1200 Subject: Fixed timeval to milliseconds calculation error milliseconds = seconds * 1000 + microseconds / 1000 --- librabbitmq/amqp_socket.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/librabbitmq/amqp_socket.c b/librabbitmq/amqp_socket.c index 6e54f7e..105b9b2 100644 --- a/librabbitmq/amqp_socket.c +++ b/librabbitmq/amqp_socket.c @@ -575,7 +575,7 @@ static int recv_with_timeout(amqp_connection_state_t state, uint64_t start, stru pfd.revents = 0; timeout_ms = timeout->tv_sec * AMQP_MS_PER_S + - timeout->tv_usec * AMQP_US_PER_MS; + timeout->tv_usec / AMQP_US_PER_MS; res = poll(&pfd, 1, timeout_ms); -- cgit v1.2.1 From 3e83192454fbcaa4e6ef18c8fc3c76f15494877a Mon Sep 17 00:00:00 2001 From: Alan Antonuk Date: Wed, 7 May 2014 20:57:14 -0700 Subject: Use gethrtime() on HP-UX for timers. HP-UX does not have clock_gettime(CLOCK_MONOTONIC), instead use platform-specific gethrtime() function. Thanks to zhongk for this fix. --- librabbitmq/amqp_timer.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/librabbitmq/amqp_timer.c b/librabbitmq/amqp_timer.c index 95606b8..2b41c83 100644 --- a/librabbitmq/amqp_timer.c +++ b/librabbitmq/amqp_timer.c @@ -90,12 +90,16 @@ amqp_get_monotonic_timestamp(void) uint64_t amqp_get_monotonic_timestamp(void) { +#ifdef __hpux + return (uint64_t)gethrtime(); +#else struct timespec tp; if (-1 == clock_gettime(CLOCK_MONOTONIC, &tp)) { return 0; } return ((uint64_t)tp.tv_sec * AMQP_NS_PER_S + (uint64_t)tp.tv_nsec); +#endif } #endif /* AMQP_POSIX_TIMER_API */ -- cgit v1.2.1 From cb1b44e2348ef26a24bbcb6a2c00ba94e372c189 Mon Sep 17 00:00:00 2001 From: Alan Antonuk Date: Wed, 7 May 2014 21:08:49 -0700 Subject: Correct #include location. sys/uio.h should be included in amqp_private.h and not amqp.h, it also should not be protected by a test for the GCC compiler. This should fix the issue with compiling rabbitmq-c on HP-UX using aCC. This fixes #183. --- librabbitmq/amqp.h | 1 - librabbitmq/amqp_private.h | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/librabbitmq/amqp.h b/librabbitmq/amqp.h index 82b7c02..441e5b9 100644 --- a/librabbitmq/amqp.h +++ b/librabbitmq/amqp.h @@ -113,7 +113,6 @@ # define AMQP_CALL __cdecl #elif defined(__GNUC__) && __GNUC__ >= 4 -# include # define AMQP_PUBLIC_FUNCTION \ __attribute__ ((visibility ("default"))) # define AMQP_PUBLIC_VARIABLE \ diff --git a/librabbitmq/amqp_private.h b/librabbitmq/amqp_private.h index c2e63c3..e11ce16 100644 --- a/librabbitmq/amqp_private.h +++ b/librabbitmq/amqp_private.h @@ -57,6 +57,7 @@ # include #else # include +# include #endif /* GCC attributes */ -- cgit v1.2.1 From 8ce585dd7d52952b0dc55a7e6db39f636d3075d6 Mon Sep 17 00:00:00 2001 From: Alan Antonuk Date: Thu, 10 Jul 2014 21:22:52 -0700 Subject: FIX: incorrect OOM for 0-len xchg in amqp_consume. This fixes a bug in amqp_consume where the function would incorrectly return an OOM condition when a 0-length exchange name was returned. Fixes #192 --- librabbitmq/amqp_consumer.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/librabbitmq/amqp_consumer.c b/librabbitmq/amqp_consumer.c index 6c6c1c9..be71118 100644 --- a/librabbitmq/amqp_consumer.c +++ b/librabbitmq/amqp_consumer.c @@ -131,6 +131,13 @@ void amqp_destroy_envelope(amqp_envelope_t *envelope) amqp_bytes_free(envelope->consumer_tag); } +static +int amqp_bytes_malloc_dup_failed(amqp_bytes_t bytes) { + if (bytes.len != 0 && bytes.bytes == NULL) { + return 1; + } + return 0; +} amqp_rpc_reply_t amqp_consume_message(amqp_connection_state_t state, amqp_envelope_t *envelope, @@ -168,9 +175,9 @@ amqp_consume_message(amqp_connection_state_t state, amqp_envelope_t *envelope, envelope->exchange = amqp_bytes_malloc_dup(delivery_method->exchange); envelope->routing_key = amqp_bytes_malloc_dup(delivery_method->routing_key); - if (NULL == envelope->consumer_tag.bytes || - NULL == envelope->exchange.bytes || - NULL == envelope->routing_key.bytes) { + if (amqp_bytes_malloc_dup_failed(envelope->consumer_tag) || + amqp_bytes_malloc_dup_failed(envelope->exchange) || + amqp_bytes_malloc_dup_failed(envelope->routing_key)) { ret.reply_type = AMQP_RESPONSE_LIBRARY_EXCEPTION; ret.library_error = AMQP_STATUS_NO_MEMORY; goto error_out2; -- cgit v1.2.1 From 357bdb369206eb91fe643b7c275ce15248b4f5f8 Mon Sep 17 00:00:00 2001 From: Mike Stitt Date: Sat, 28 Jun 2014 09:12:46 -0400 Subject: Allow INITIAL bufffer and page size configuration Signed-off-by: Mike Stitt --- librabbitmq/amqp_connection.c | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/librabbitmq/amqp_connection.c b/librabbitmq/amqp_connection.c index 5d70b07..ccaa73d 100644 --- a/librabbitmq/amqp_connection.c +++ b/librabbitmq/amqp_connection.c @@ -48,9 +48,18 @@ #include #include -#define INITIAL_FRAME_POOL_PAGE_SIZE 65536 -#define INITIAL_DECODING_POOL_PAGE_SIZE 131072 -#define INITIAL_INBOUND_SOCK_BUFFER_SIZE 131072 +#ifndef AMQP_INITIAL_FRAME_POOL_PAGE_SIZE +#define AMQP_INITIAL_FRAME_POOL_PAGE_SIZE 65536 +#endif + +#ifndef AMQP_INITIAL_DECODING_POOL_PAGE_SIZE +#define AMQP_INITIAL_DECODING_POOL_PAGE_SIZE 131072 +#endif + +#ifndef AMQP_INITIAL_INBOUND_SOCK_BUFFER_SIZE +#define AMQP_INITIAL_INBOUND_SOCK_BUFFER_SIZE 131072 +#endif + #define ENFORCE_STATE(statevec, statenum) \ { \ @@ -72,7 +81,7 @@ amqp_connection_state_t amqp_new_connection(void) return NULL; } - res = amqp_tune_connection(state, 0, INITIAL_FRAME_POOL_PAGE_SIZE, 0); + res = amqp_tune_connection(state, 0, AMQP_INITIAL_FRAME_POOL_PAGE_SIZE, 0); if (0 != res) { goto out_nomem; } @@ -85,8 +94,8 @@ amqp_connection_state_t amqp_new_connection(void) is also the minimum frame size */ state->target_size = 8; - state->sock_inbound_buffer.len = INITIAL_INBOUND_SOCK_BUFFER_SIZE; - state->sock_inbound_buffer.bytes = malloc(INITIAL_INBOUND_SOCK_BUFFER_SIZE); + state->sock_inbound_buffer.len = AMQP_INITIAL_INBOUND_SOCK_BUFFER_SIZE; + state->sock_inbound_buffer.bytes = malloc(AMQP_INITIAL_INBOUND_SOCK_BUFFER_SIZE); if (state->sock_inbound_buffer.bytes == NULL) { goto out_nomem; } -- cgit v1.2.1 From 38c8cdcd64b0a260382c5f2fc73e5abe1fc766fc Mon Sep 17 00:00:00 2001 From: Alan Antonuk Date: Fri, 11 Jul 2014 07:55:40 -0700 Subject: Remove unused INITIAL_DECODING_POOL_PAGE_SIZE def AMQP_INITIAL_DECODING_POOL_PAGE_SIZE isn't used anywhere in the code. Getting rid of it. --- librabbitmq/amqp_connection.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/librabbitmq/amqp_connection.c b/librabbitmq/amqp_connection.c index ccaa73d..078ffb6 100644 --- a/librabbitmq/amqp_connection.c +++ b/librabbitmq/amqp_connection.c @@ -52,10 +52,6 @@ #define AMQP_INITIAL_FRAME_POOL_PAGE_SIZE 65536 #endif -#ifndef AMQP_INITIAL_DECODING_POOL_PAGE_SIZE -#define AMQP_INITIAL_DECODING_POOL_PAGE_SIZE 131072 -#endif - #ifndef AMQP_INITIAL_INBOUND_SOCK_BUFFER_SIZE #define AMQP_INITIAL_INBOUND_SOCK_BUFFER_SIZE 131072 #endif -- cgit v1.2.1 From 8956003e3d1fd97cf52969a2c4f988cbcb81100d Mon Sep 17 00:00:00 2001 From: Alan Antonuk Date: Mon, 14 Jul 2014 22:30:27 -0700 Subject: FIX: Improve invalid frame detection code. Improve detection of invalid AMQP frame header before allocating frame buffer. This fixes #187. Thanks to Mike Stitt for the inspiration on this. --- librabbitmq/amqp_connection.c | 14 +++++++++++--- librabbitmq/amqp_socket.c | 2 ++ 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/librabbitmq/amqp_connection.c b/librabbitmq/amqp_connection.c index 078ffb6..cb82e46 100644 --- a/librabbitmq/amqp_connection.c +++ b/librabbitmq/amqp_connection.c @@ -279,14 +279,22 @@ int amqp_handle_input(amqp_connection_state_t state, /* frame length is 3 bytes in */ channel = amqp_d16(raw_frame, 1); - channel_pool = amqp_get_or_create_channel_pool(state, channel); - if (NULL == channel_pool) { - return AMQP_STATUS_NO_MEMORY; + if ((int)channel > state->channel_max) { + return AMQP_STATUS_BAD_AMQP_DATA; } state->target_size = amqp_d32(raw_frame, 3) + HEADER_SIZE + FOOTER_SIZE; + if ((size_t)state->frame_max < state->target_size) { + return AMQP_STATUS_BAD_AMQP_DATA; + } + + channel_pool = amqp_get_or_create_channel_pool(state, channel); + if (NULL == channel_pool) { + return AMQP_STATUS_NO_MEMORY; + } + amqp_pool_alloc_bytes(channel_pool, state->target_size, &state->inbound_buffer); if (NULL == state->inbound_buffer.bytes) { return AMQP_STATUS_NO_MEMORY; diff --git a/librabbitmq/amqp_socket.c b/librabbitmq/amqp_socket.c index 105b9b2..154c464 100644 --- a/librabbitmq/amqp_socket.c +++ b/librabbitmq/amqp_socket.c @@ -1260,6 +1260,8 @@ static amqp_rpc_reply_t amqp_login_inner(amqp_connection_state_t state, if (server_channel_max != 0 && server_channel_max < channel_max) { channel_max = server_channel_max; + } else if (server_channel_max == 0 && channel_max == 0) { + channel_max = UINT16_MAX; } if (server_frame_max != 0 && server_frame_max < frame_max) { -- cgit v1.2.1 From c8ba350d000739cda0a8fcc7166a44fae874039e Mon Sep 17 00:00:00 2001 From: Alan Antonuk Date: Sun, 20 Jul 2014 19:37:14 -0700 Subject: Add clang-format configuration file. --- .clang-format | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 .clang-format diff --git a/.clang-format b/.clang-format new file mode 100644 index 0000000..8aa6b1a --- /dev/null +++ b/.clang-format @@ -0,0 +1,47 @@ +--- +# BasedOnStyle: Google +AccessModifierOffset: -1 +ConstructorInitializerIndentWidth: 4 +AlignEscapedNewlinesLeft: true +AlignTrailingComments: true +AllowAllParametersOfDeclarationOnNextLine: true +AllowShortIfStatementsOnASingleLine: true +AllowShortLoopsOnASingleLine: true +AlwaysBreakTemplateDeclarations: true +AlwaysBreakBeforeMultilineStrings: true +BreakBeforeBinaryOperators: false +BreakBeforeTernaryOperators: true +BreakConstructorInitializersBeforeComma: false +BinPackParameters: true +ColumnLimit: 80 +ConstructorInitializerAllOnOneLineOrOnePerLine: true +DerivePointerBinding: true +ExperimentalAutoDetectBinPacking: false +IndentCaseLabels: true +MaxEmptyLinesToKeep: 1 +NamespaceIndentation: None +ObjCSpaceBeforeProtocolList: false +PenaltyBreakBeforeFirstCallParameter: 1 +PenaltyBreakComment: 60 +PenaltyBreakString: 1000 +PenaltyBreakFirstLessLess: 120 +PenaltyExcessCharacter: 1000000 +PenaltyReturnTypeOnItsOwnLine: 200 +PointerBindsToType: true +SpacesBeforeTrailingComments: 2 +Cpp11BracedListStyle: true +Standard: Auto +IndentWidth: 2 +TabWidth: 8 +UseTab: Never +BreakBeforeBraces: Attach +IndentFunctionDeclarationAfterType: true +SpacesInParentheses: false +SpacesInAngles: false +SpaceInEmptyParentheses: false +SpacesInCStyleCastParentheses: false +SpaceAfterControlStatementKeyword: true +SpaceBeforeAssignmentOperators: true +ContinuationIndentWidth: 4 +... + -- cgit v1.2.1 From c7716b8bb9080bdec51dcbd571d16eeaeea5e5b6 Mon Sep 17 00:00:00 2001 From: Alan Antonuk Date: Sat, 26 Jul 2014 09:54:48 -0700 Subject: Correct htonll macro detection in CMake. CMake's check_function_exists() only checks for a symbol being defined in a library, and does not cover the instance where a function may be defined as a macro a header. Use check_symbol_exists() to check arpa/inet.h header for symbol existance of htonll. This fixes #200 --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a51d056..d4b4c4d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -103,7 +103,7 @@ set(CMAKE_REQUIRED_LIBRARIES ${SOCKET_LIBRARIES}) if (WIN32) check_symbol_exists(htonll Winsock2.h HAVE_HTONLL) else (WIN32) - check_function_exists(htonll HAVE_HTONLL) + check_symbol_exists(htonll arpa/inet.h HAVE_HTONLL) endif (WIN32) cmake_pop_check_state() -- cgit v1.2.1 From 6b552b5cbbf4522bf92cfcc1e258541a7a6e8e8a Mon Sep 17 00:00:00 2001 From: Alan Antonuk Date: Sun, 27 Jul 2014 21:45:38 -0700 Subject: Ignore build directories. --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 6bca1bb..2dd978d 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,7 @@ .libs /aclocal.m4 /autom4te.cache +/bin* /compile /config.guess /config.h -- cgit v1.2.1 From 4dc4eda0b0f87e903bbb67aab9a772a184bf3054 Mon Sep 17 00:00:00 2001 From: Alan Antonuk Date: Sun, 27 Jul 2014 22:08:25 -0700 Subject: Fix: remove superfulous assignment in amqp_socket.c sockfd is assigned, then assigned again unconditionally without being read from. There's no point in this statement, so lets get rid of it. --- librabbitmq/amqp_socket.c | 1 - 1 file changed, 1 deletion(-) diff --git a/librabbitmq/amqp_socket.c b/librabbitmq/amqp_socket.c index 154c464..660ebbb 100644 --- a/librabbitmq/amqp_socket.c +++ b/librabbitmq/amqp_socket.c @@ -308,7 +308,6 @@ int amqp_open_socket_noblock(char const *hostname, for (addr = address_list; addr; addr = addr->ai_next) { if (-1 != sockfd) { amqp_os_socket_close(sockfd); - sockfd = -1; } sockfd = amqp_os_socket_socket(addr->ai_family, addr->ai_socktype, addr->ai_protocol); -- cgit v1.2.1 From 45302cf00f6e585cba5ff1df6759de2c50e3d968 Mon Sep 17 00:00:00 2001 From: Alan Antonuk Date: Sat, 2 Aug 2014 21:52:09 -0700 Subject: FIX: don't range-check channel_ids. Even if a channel_max is specified, channel_ids can be any number, so don't range-check channel_ids received. At present this gets rabbitmq-c back into compliance with the way the RabbitMQ broker works. See issue #187, #195 To correctly enforce channel_max from the client side, rabbitmq-c would need to track open channels, which is a bit more involved to do correctly. --- librabbitmq/amqp_connection.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/librabbitmq/amqp_connection.c b/librabbitmq/amqp_connection.c index cb82e46..88136cd 100644 --- a/librabbitmq/amqp_connection.c +++ b/librabbitmq/amqp_connection.c @@ -279,10 +279,6 @@ int amqp_handle_input(amqp_connection_state_t state, /* frame length is 3 bytes in */ channel = amqp_d16(raw_frame, 1); - if ((int)channel > state->channel_max) { - return AMQP_STATUS_BAD_AMQP_DATA; - } - state->target_size = amqp_d32(raw_frame, 3) + HEADER_SIZE + FOOTER_SIZE; -- cgit v1.2.1 From 8dea9a04f61e7829b939711c292b65916278a4d4 Mon Sep 17 00:00:00 2001 From: Alan Antonuk Date: Mon, 11 Aug 2014 21:36:11 -0700 Subject: Preparation for v0.5.1 release. --- CMakeLists.txt | 2 +- ChangeLog.md | 24 ++++++++++++++++++++++++ README.md | 4 ++-- configure.ac | 4 ++-- librabbitmq/amqp.h | 2 +- 5 files changed, 30 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d4b4c4d..59b56b9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,7 +13,7 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake) # 4. If any interfaces have been removed since the last public release, then set age to 0. set(RMQ_SOVERSION_CURRENT 3) -set(RMQ_SOVERSION_REVISION 0) +set(RMQ_SOVERSION_REVISION 1) set(RMQ_SOVERSION_AGE 2) math(EXPR RMQ_SOVERSION_MAJOR "${RMQ_SOVERSION_CURRENT} - ${RMQ_SOVERSION_AGE}") diff --git a/ChangeLog.md b/ChangeLog.md index 2f9d2f9..c19a1c0 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -1,4 +1,28 @@ # Change Log +## Changes since v0.5.0 (a.k.a., v0.5.1) +### Enhancements: +- `a566929` SSL: Add support for wildcards in hostname verification (Mike + Steinert) +- `a78aa8a` Lib: Use poll(2) instead of select(2) for timeouts on sockets. +- `357bdb3` Lib: support for specifying frame and decoding pool sizes. (Mike + Stitt) +- `8956003` Lib: improve invalid frame detection code. + +### Bug fixes: +- `b852f84` Lib: Add missing amqp_get_server_properties() function. +- `7001e82` Lib: Add missing ssize_t on Win32 (emazv72) +- `c2ce2cb` Lib: Correctly specify WINVER on Win32 when unspecified. +- `fe844e4` CMake: specify -DHAVE_CONFIG_H in examples. +- `932de5f` Lib: correct time computation on Win32 (jestor) +- `3e83192` HPUX: use gethrtime on HP-UX for timers. +- `cb1b44e` HPUX: correct include location of sys/uio.h +- `8ce585d` Lib: incorrect OOM condition when 0-lenth exchange name is received. +- `c7716b8` CMake: correct htonll detection code on platforms defined with a + macro. +- `4dc4eda` Lib: remove unused assignment. +- `45302cf` Lib: remove range-check of channel-ids. + + ## Changes since v0.4.1 (a.k.a., v0.5.0): ### Major changes: - Add amqp_get_broker_properties() function 5c7c40adc1 diff --git a/README.md b/README.md index 53f1074..b7ce488 100644 --- a/README.md +++ b/README.md @@ -16,12 +16,12 @@ rabbitmq-discuss mailing list: ## Latest Stable Version -The latest stable release of [rabbitmq-c is v0.5.0](https://github.com/alanxz/rabbitmq-c/releases/tag/v0.5.0). +The latest stable release of [rabbitmq-c is v0.5.1](https://github.com/alanxz/rabbitmq-c/releases/tag/v0.5.1). A complete list of changes can be found in the [Change Log](ChangeLog.md) The v0.5.0 source tarball can be downloaded from: - + API documentation for v0.5.0+ can viewed from: diff --git a/configure.ac b/configure.ac index 0d60b72..045f8cb 100644 --- a/configure.ac +++ b/configure.ac @@ -3,7 +3,7 @@ AC_PREREQ([2.59]) m4_define([major_version], [0]) m4_define([minor_version], [5]) -m4_define([micro_version], [0]) +m4_define([micro_version], [1]) # Follow all steps below in order to calculate new ABI version when updating the library # NOTE: THIS IS UNRELATED to the actual project version @@ -13,7 +13,7 @@ m4_define([micro_version], [0]) # 3. If any interfaces have been added since the last public release, then increment age. # 4. If any interfaces have been removed since the last public release, then set age to 0. m4_define([soversion_current], [3]) -m4_define([soversion_revision], [0]) +m4_define([soversion_revision], [1]) m4_define([soversion_age], [2]) AC_INIT([rabbitmq-c], [major_version.minor_version.micro_version], diff --git a/librabbitmq/amqp.h b/librabbitmq/amqp.h index 441e5b9..f780563 100644 --- a/librabbitmq/amqp.h +++ b/librabbitmq/amqp.h @@ -225,7 +225,7 @@ AMQP_BEGIN_DECLS #define AMQP_VERSION_MAJOR 0 #define AMQP_VERSION_MINOR 5 #define AMQP_VERSION_PATCH 1 -#define AMQP_VERSION_IS_RELEASE 0 +#define AMQP_VERSION_IS_RELEASE 1 /** -- cgit v1.2.1 From a2ee005e3d781055437513e4318ad414a59969bd Mon Sep 17 00:00:00 2001 From: Alan Antonuk Date: Mon, 11 Aug 2014 21:37:45 -0700 Subject: Bumping version for development. --- configure.ac | 2 +- librabbitmq/amqp.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/configure.ac b/configure.ac index 045f8cb..8d6416d 100644 --- a/configure.ac +++ b/configure.ac @@ -3,7 +3,7 @@ AC_PREREQ([2.59]) m4_define([major_version], [0]) m4_define([minor_version], [5]) -m4_define([micro_version], [1]) +m4_define([micro_version], [2]) # Follow all steps below in order to calculate new ABI version when updating the library # NOTE: THIS IS UNRELATED to the actual project version diff --git a/librabbitmq/amqp.h b/librabbitmq/amqp.h index f780563..0f3a932 100644 --- a/librabbitmq/amqp.h +++ b/librabbitmq/amqp.h @@ -224,8 +224,8 @@ AMQP_BEGIN_DECLS #define AMQP_VERSION_MAJOR 0 #define AMQP_VERSION_MINOR 5 -#define AMQP_VERSION_PATCH 1 -#define AMQP_VERSION_IS_RELEASE 1 +#define AMQP_VERSION_PATCH 2 +#define AMQP_VERSION_IS_RELEASE 0 /** -- cgit v1.2.1 From fcdf0f809b44cc42f628a42793a3dbb55020f16f Mon Sep 17 00:00:00 2001 From: Alan Antonuk Date: Wed, 13 Aug 2014 21:25:29 -0700 Subject: autoconf: look for htonll in arpa/inet.h htonll maybe defined as a macro, look for it in the arpa/inet.h. CMake build system already does the right thing. Fixes #206 --- configure.ac | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 8d6416d..7692c54 100644 --- a/configure.ac +++ b/configure.ac @@ -99,7 +99,26 @@ AC_SEARCH_LIBS([socket], [socket], [], [AC_MSG_ERROR([cannot find socket library (library with socket symbol)])], [-lnsl])]) AC_SEARCH_LIBS([clock_gettime], [rt]) -AC_CHECK_FUNCS([htonll]) +AC_MSG_CHECKING([if htonll is defined]) + +dnl # Check for htonll +AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[ + #include + ]], + [[ + return htonll(0); + ]] + )], + [ + AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_HTONLL, 1, [Define to 1 if the function (or macro) htonll exists.]) + ], + [ + AC_MSG_RESULT(no) + ] +) # Configure SSL/TLS AC_ARG_WITH([ssl], -- cgit v1.2.1 From 977e125977db1f0a729abfd42b511a82688a53c4 Mon Sep 17 00:00:00 2001 From: Alan Antonuk Date: Sat, 16 Aug 2014 22:17:52 -0700 Subject: Add usable YCM configuration file. --- .gitignore | 2 +- .ycm_extra_conf.py | 155 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 156 insertions(+), 1 deletion(-) create mode 100644 .ycm_extra_conf.py diff --git a/.gitignore b/.gitignore index 2dd978d..d0765ce 100644 --- a/.gitignore +++ b/.gitignore @@ -61,7 +61,7 @@ tools/amqp-publish tools/doc/*.1 tools/doc/*.7 tools/doc/man-date.ent -.ycm_extra_conf.py* +.ycm_extra_conf.py? .DS_Store # Ignore editor swap files diff --git a/.ycm_extra_conf.py b/.ycm_extra_conf.py new file mode 100644 index 0000000..136e97d --- /dev/null +++ b/.ycm_extra_conf.py @@ -0,0 +1,155 @@ +# This file is NOT licensed under the GPLv3, which is the license for the rest +# of YouCompleteMe. +# +# Here's the license text for this file: +# +# This is free and unencumbered software released into the public domain. +# +# Anyone is free to copy, modify, publish, use, compile, sell, or +# distribute this software, either in source code form or as a compiled +# binary, for any purpose, commercial or non-commercial, and by any +# means. +# +# In jurisdictions that recognize copyright laws, the author or authors +# of this software dedicate any and all copyright interest in the +# software to the public domain. We make this dedication for the benefit +# of the public at large and to the detriment of our heirs and +# successors. We intend this dedication to be an overt act of +# relinquishment in perpetuity of all present and future rights to this +# software under copyright law. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +# IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR +# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +# OTHER DEALINGS IN THE SOFTWARE. +# +# For more information, please refer to + +import os +import ycm_core + +# These are the compilation flags that will be used in case there's no +# compilation database set (by default, one is not set). +# CHANGE THIS LIST OF FLAGS. YES, THIS IS THE DROID YOU HAVE BEEN LOOKING FOR. +flags = [ +'-Wall', +'-Wextra', +# THIS IS IMPORTANT! Without a "-std=" flag, clang won't know which +# language to use when compiling headers. So it will guess. Badly. So C++ +# headers will be compiled as C headers. You don't want that so ALWAYS specify +# a "-std=". +# For a C project, you would set this to something like 'c99' instead of +# 'c++11'. +'-std=c89', +# ...and the same thing goes for the magic -x option which specifies the +# language that the files to be compiled are written in. This is mostly +# relevant for c++ headers. +# For a C project, you would set this to 'c' instead of 'c++'. +'-x', +'c', +'-I', './librabbitmq', +] + + +# Set this to the absolute path to the folder (NOT the file!) containing the +# compile_commands.json file to use that instead of 'flags'. See here for +# more details: http://clang.llvm.org/docs/JSONCompilationDatabase.html +# +# You can get CMake to generate this file for you by adding: +# set( CMAKE_EXPORT_COMPILE_COMMANDS 1 ) +# to your CMakeLists.txt file. +# +# Most projects will NOT need to set this to anything; you can just change the +# 'flags' list of compilation flags. Notice that YCM itself uses that approach. +compilation_database_folder = '' + +if os.path.exists( compilation_database_folder ): + database = ycm_core.CompilationDatabase( compilation_database_folder ) +else: + database = None + +SOURCE_EXTENSIONS = [ '.cpp', '.cxx', '.cc', '.c', '.m', '.mm' ] + +def DirectoryOfThisScript(): + return os.path.dirname( os.path.abspath( __file__ ) ) + + +def MakeRelativePathsInFlagsAbsolute( flags, working_directory ): + if not working_directory: + return list( flags ) + new_flags = [] + make_next_absolute = False + path_flags = [ '-isystem', '-I', '-iquote', '--sysroot=' ] + for flag in flags: + new_flag = flag + + if make_next_absolute: + make_next_absolute = False + if not flag.startswith( '/' ): + new_flag = os.path.join( working_directory, flag ) + + for path_flag in path_flags: + if flag == path_flag: + make_next_absolute = True + break + + if flag.startswith( path_flag ): + path = flag[ len( path_flag ): ] + new_flag = path_flag + os.path.join( working_directory, path ) + break + + if new_flag: + new_flags.append( new_flag ) + return new_flags + + +def IsHeaderFile( filename ): + extension = os.path.splitext( filename )[ 1 ] + return extension in [ '.h', '.hxx', '.hpp', '.hh' ] + + +def GetCompilationInfoForFile( filename ): + # The compilation_commands.json file generated by CMake does not have entries + # for header files. So we do our best by asking the db for flags for a + # corresponding source file, if any. If one exists, the flags for that file + # should be good enough. + if IsHeaderFile( filename ): + basename = os.path.splitext( filename )[ 0 ] + for extension in SOURCE_EXTENSIONS: + replacement_file = basename + extension + if os.path.exists( replacement_file ): + compilation_info = database.GetCompilationInfoForFile( + replacement_file ) + if compilation_info.compiler_flags_: + return compilation_info + return None + return database.GetCompilationInfoForFile( filename ) + + +def FlagsForFile( filename, **kwargs ): + if database: + # Bear in mind that compilation_info.compiler_flags_ does NOT return a + # python list, but a "list-like" StringVec object + compilation_info = GetCompilationInfoForFile( filename ) + if not compilation_info: + relative_to = DirectoryOfThisScript() + return { + 'flags': MakeRelativePathsInFlagsAbsolute( flags, relative_to ), + 'do_cache': True + } + + final_flags = MakeRelativePathsInFlagsAbsolute( + compilation_info.compiler_flags_, + compilation_info.compiler_working_dir_ ) + + else: + relative_to = DirectoryOfThisScript() + final_flags = MakeRelativePathsInFlagsAbsolute( flags, relative_to ) + + return { + 'flags': final_flags, + 'do_cache': True + } -- cgit v1.2.1 From 5790ec76336955c8dd3ff4e94d36389c562a351b Mon Sep 17 00:00:00 2001 From: Kouhei Sutou Date: Mon, 25 Aug 2014 15:55:12 +0900 Subject: ssl: Fix a bug that host name verification failure isn't reported There is an unexpected local variable shadowing in amqp_ssl_socket_open(). So the following code is meaningless unexpectedly. status = AMQP_STATUS_SSL_HOSTNAME_VERIFY_FAILED --- librabbitmq/amqp_openssl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/librabbitmq/amqp_openssl.c b/librabbitmq/amqp_openssl.c index ab8a94e..43018c9 100644 --- a/librabbitmq/amqp_openssl.c +++ b/librabbitmq/amqp_openssl.c @@ -271,8 +271,8 @@ amqp_ssl_socket_open(void *base, const char *host, int port, struct timeval *tim goto error_out3; } if (self->verify) { - int status = amqp_ssl_socket_verify_hostname(self, host); - if (status) { + int verify_status = amqp_ssl_socket_verify_hostname(self, host); + if (verify_status) { self->internal_error = 0; status = AMQP_STATUS_SSL_HOSTNAME_VERIFY_FAILED; goto error_out3; -- cgit v1.2.1 From d60c28ca0359efdc382ccc58853f925c97bcd4fd Mon Sep 17 00:00:00 2001 From: Alan Antonuk Date: Mon, 25 Aug 2014 21:49:04 -0700 Subject: Suppress OpenSSL deprecation warnings on OSX --- Makefile.am | 3 +++ configure.ac | 4 ++++ librabbitmq/CMakeLists.txt | 5 +++++ librabbitmq/amqp_openssl.c | 4 ---- 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/Makefile.am b/Makefile.am index 8cd767a..9df689a 100644 --- a/Makefile.am +++ b/Makefile.am @@ -53,6 +53,9 @@ librabbitmq_librabbitmq_la_SOURCES += \ librabbitmq/amqp_hostcheck.c \ librabbitmq/amqp_hostcheck.h \ librabbitmq/amqp_openssl.c +if OS_APPLE +librabbitmq_librabbitmq_la_CFLAGS += -Wno-deprecated-declarations +endif endif if SSL_POLARSSL diff --git a/configure.ac b/configure.ac index 7692c54..df9338d 100644 --- a/configure.ac +++ b/configure.ac @@ -61,13 +61,17 @@ AC_SUBST([LT_AGE]) # OS setup os_unix=no +os_apple=no os_win32=no AS_CASE([$host], [*-*-mingw*], [os_win32=yes], + [*-apple-darwin*], + [os_apple=yes; os_unix=yes], [*], [os_unix=yes]) AM_CONDITIONAL([OS_UNIX], [test "x$os_unix" = xyes]) +AM_CONDITIONAL([OS_APPLE], [test "x$os_apple" = xyes]) AM_CONDITIONAL([OS_WIN32], [test "x$os_win32" = xyes]) AC_DEFINE([ENABLE_THREAD_SAFETY], [1], [Define to 1 to enable thread safety]) diff --git a/librabbitmq/CMakeLists.txt b/librabbitmq/CMakeLists.txt index d3623b3..2c3032e 100644 --- a/librabbitmq/CMakeLists.txt +++ b/librabbitmq/CMakeLists.txt @@ -88,6 +88,11 @@ if (ENABLE_SSL_SUPPORT) ) include_directories(${OPENSSL_INCLUDE_DIR}) set(AMQP_SSL_LIBS ${OPENSSL_LIBRARIES}) + if (APPLE) + # Apple has deprecated OpenSSL in 10.7+. This disables that warning. + set_source_files_properties(${AMQP_SSL_SRCS} + PROPERTIES COMPILE_FLAGS -Wno-deprecated-declarations) + endif() elseif (SSL_ENGINE STREQUAL "cyaSSL") set(AMQP_SSL_SRCS ${AMQP_SSL_SOCKET_H_PATH} amqp_cyassl.c) diff --git a/librabbitmq/amqp_openssl.c b/librabbitmq/amqp_openssl.c index 43018c9..9066d23 100644 --- a/librabbitmq/amqp_openssl.c +++ b/librabbitmq/amqp_openssl.c @@ -25,10 +25,6 @@ #include "config.h" #endif -#if defined(__APPLE__) && defined(__MACH__) -# define MAC_OS_X_VERSION_MIN_REQUIRED MAC_OS_X_VERSION_10_6 -#endif - #include "amqp_ssl_socket.h" #include "amqp_socket.h" #include "amqp_hostcheck.h" -- cgit v1.2.1 From 53286d6c69aa1290dcfc61847bae35c07c6e05aa Mon Sep 17 00:00:00 2001 From: Alan Antonuk Date: Mon, 25 Aug 2014 22:01:11 -0700 Subject: Enable compiler warnings with Clang --- CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 59b56b9..ae9d98c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -36,6 +36,8 @@ set(VERSION ${_API_VERSION_MAJOR}.${_API_VERSION_MINOR}.${_API_VERSION_PATCH}) if (MSVC) set(CMAKE_C_FLAGS "/W4 /nologo ${CMAKE_C_FLAGS}") +elseif (CMAKE_C_COMPILER_ID MATCHES ".*Clang") + set(CMAKE_C_FLAGS "-Wall -Wextra -pedantic -Wstrict-prototypes -Wcast-align -Wno-unused-function -fno-common -fvisibility=hidden") elseif (CMAKE_COMPILER_IS_GNUCC) set(RMQ_C_FLAGS "-Wall -Wextra -pedantic -Wstrict-prototypes -Wcast-align -Wno-unused-function -fno-common") execute_process(COMMAND ${CMAKE_C_COMPILER} -dumpversion OUTPUT_VARIABLE GCC_VERSION) -- cgit v1.2.1 From 072191a6e9815c54bac2ce276db8b7abf26c3230 Mon Sep 17 00:00:00 2001 From: Alan Antonuk Date: Mon, 25 Aug 2014 22:54:28 -0700 Subject: Add platform, version, copyright client properties Add 'platform' 'version', 'copyright' client-properties to start-ok method during connection handshake. Adapted from: https://github.com/synety-jdebp/rabbitmq-c/commit/e3c76e1887ff50378f6146167daa024dbd7d4eeb by: Jonathan de Boyne Pollard --- cmake/config.h.in | 2 ++ configure.ac | 1 + librabbitmq/amqp_private.h | 3 +++ librabbitmq/amqp_socket.c | 22 ++++++++++++++++++++-- 4 files changed, 26 insertions(+), 2 deletions(-) diff --git a/cmake/config.h.in b/cmake/config.h.in index e7a83c4..7f3fa71 100644 --- a/cmake/config.h.in +++ b/cmake/config.h.in @@ -8,4 +8,6 @@ #cmakedefine HAVE_HTONLL +#define AMQ_PLATFORM "@CMAKE_SYSTEM@" + #endif /* CONFIG_H */ diff --git a/configure.ac b/configure.ac index df9338d..6d465b0 100644 --- a/configure.ac +++ b/configure.ac @@ -188,6 +188,7 @@ AM_CONDITIONAL([EXAMPLES], [test "x$enable_examples" = "xyes"]) AC_SUBST([requires_private], [$ssl_pkg_required]) AC_SUBST([libs_private], [$LIBS]) +AC_DEFINE_UNQUOTED([AMQ_PLATFORM], ["$host_os"], [Host operating system string]) AC_CONFIG_HEADERS([config.h]) AC_CONFIG_FILES([ librabbitmq.pc diff --git a/librabbitmq/amqp_private.h b/librabbitmq/amqp_private.h index e11ce16..21f4ead 100644 --- a/librabbitmq/amqp_private.h +++ b/librabbitmq/amqp_private.h @@ -41,6 +41,9 @@ #include "config.h" #endif +#define AMQ_COPYRIGHT "Copyright (c) 2007-2014 VMWare Inc, Tony Garnock-Jones," \ + " and Alan Antonuk." + #include "amqp.h" #include "amqp_framing.h" #include diff --git a/librabbitmq/amqp_socket.c b/librabbitmq/amqp_socket.c index 660ebbb..3a2881e 100644 --- a/librabbitmq/amqp_socket.c +++ b/librabbitmq/amqp_socket.c @@ -1158,7 +1158,7 @@ static amqp_rpc_reply_t amqp_login_inner(amqp_connection_state_t state, } { - amqp_table_entry_t default_properties[2]; + amqp_table_entry_t default_properties[5]; amqp_table_t default_table; amqp_connection_start_ok_t s; amqp_pool_t *channel_pool; @@ -1182,9 +1182,27 @@ static amqp_rpc_reply_t amqp_login_inner(amqp_connection_state_t state, default_properties[0].value.value.bytes = amqp_cstring_bytes("rabbitmq-c"); - default_properties[1].key = amqp_cstring_bytes("information"); + /* version */ + default_properties[1].key = amqp_cstring_bytes("version"); default_properties[1].value.kind = AMQP_FIELD_KIND_UTF8; default_properties[1].value.value.bytes = + amqp_cstring_bytes(AMQP_VERSION_STRING); + + /* platform */ + default_properties[2].key = amqp_cstring_bytes("platform"); + default_properties[2].value.kind = AMQP_FIELD_KIND_UTF8; + default_properties[2].value.value.bytes = + amqp_cstring_bytes(AMQ_PLATFORM); + + /* copyright */ + default_properties[3].key = amqp_cstring_bytes("copyright"); + default_properties[3].value.kind = AMQP_FIELD_KIND_UTF8; + default_properties[3].value.value.bytes = + amqp_cstring_bytes(AMQ_COPYRIGHT); + + default_properties[4].key = amqp_cstring_bytes("information"); + default_properties[4].value.kind = AMQP_FIELD_KIND_UTF8; + default_properties[4].value.value.bytes = amqp_cstring_bytes("See https://github.com/alanxz/rabbitmq-c"); default_table.entries = default_properties; -- cgit v1.2.1 From bfd8cc9129da46136691a88c06d505b78f0043ae Mon Sep 17 00:00:00 2001 From: Alan Antonuk Date: Tue, 26 Aug 2014 21:31:42 -0700 Subject: Update copyright on files changed in 2014. --- librabbitmq/amqp.h | 2 +- librabbitmq/amqp_connection.c | 2 +- librabbitmq/amqp_consumer.c | 2 +- librabbitmq/amqp_openssl.c | 6 +++++- librabbitmq/amqp_private.h | 2 +- librabbitmq/amqp_socket.c | 2 +- librabbitmq/amqp_socket.h | 6 +++++- librabbitmq/amqp_ssl_socket.h | 6 +++++- librabbitmq/amqp_tcp_socket.h | 6 +++++- librabbitmq/amqp_timer.c | 3 ++- librabbitmq/amqp_timer.h | 3 ++- librabbitmq/win32/threads.h | 6 +++++- 12 files changed, 34 insertions(+), 12 deletions(-) diff --git a/librabbitmq/amqp.h b/librabbitmq/amqp.h index 0f3a932..b120d83 100644 --- a/librabbitmq/amqp.h +++ b/librabbitmq/amqp.h @@ -4,7 +4,7 @@ * ***** BEGIN LICENSE BLOCK ***** * Version: MIT * - * Portions created by Alan Antonuk are Copyright (c) 2012-2013 + * Portions created by Alan Antonuk are Copyright (c) 2012-2014 * Alan Antonuk. All Rights Reserved. * * Portions created by VMware are Copyright (c) 2007-2012 VMware, Inc. diff --git a/librabbitmq/amqp_connection.c b/librabbitmq/amqp_connection.c index 88136cd..3315969 100644 --- a/librabbitmq/amqp_connection.c +++ b/librabbitmq/amqp_connection.c @@ -3,7 +3,7 @@ * ***** BEGIN LICENSE BLOCK ***** * Version: MIT * - * Portions created by Alan Antonuk are Copyright (c) 2012-2013 + * Portions created by Alan Antonuk are Copyright (c) 2012-2014 * Alan Antonuk. All Rights Reserved. * * Portions created by VMware are Copyright (c) 2007-2012 VMware, Inc. diff --git a/librabbitmq/amqp_consumer.c b/librabbitmq/amqp_consumer.c index be71118..cf08fd5 100644 --- a/librabbitmq/amqp_consumer.c +++ b/librabbitmq/amqp_consumer.c @@ -3,7 +3,7 @@ * ***** BEGIN LICENSE BLOCK ***** * Version: MIT * - * Portions created by Alan Antonuk are Copyright (c) 2013 + * Portions created by Alan Antonuk are Copyright (c) 2013-2014 * Alan Antonuk. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person diff --git a/librabbitmq/amqp_openssl.c b/librabbitmq/amqp_openssl.c index 9066d23..393a84e 100644 --- a/librabbitmq/amqp_openssl.c +++ b/librabbitmq/amqp_openssl.c @@ -1,6 +1,10 @@ /* vim:set ft=c ts=2 sw=2 sts=2 et cindent: */ /* - * Copyright 2012-2013 Michael Steinert + * Portions created by Alan Antonuk are Copyright (c) 2012-2014 Alan Antonuk. + * All Rights Reserved. + * + * Portions created by Michael Steinert are Copyright (c) 2012-2014 Michael + * Steinert. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), diff --git a/librabbitmq/amqp_private.h b/librabbitmq/amqp_private.h index 21f4ead..77a8f39 100644 --- a/librabbitmq/amqp_private.h +++ b/librabbitmq/amqp_private.h @@ -6,7 +6,7 @@ * ***** BEGIN LICENSE BLOCK ***** * Version: MIT * - * Portions created by Alan Antonuk are Copyright (c) 2012-2013 + * Portions created by Alan Antonuk are Copyright (c) 2012-2014 * Alan Antonuk. All Rights Reserved. * * Portions created by VMware are Copyright (c) 2007-2012 VMware, Inc. diff --git a/librabbitmq/amqp_socket.c b/librabbitmq/amqp_socket.c index 3a2881e..29a7389 100644 --- a/librabbitmq/amqp_socket.c +++ b/librabbitmq/amqp_socket.c @@ -3,7 +3,7 @@ * ***** BEGIN LICENSE BLOCK ***** * Version: MIT * - * Portions created by Alan Antonuk are Copyright (c) 2012-2013 + * Portions created by Alan Antonuk are Copyright (c) 2012-2014 * Alan Antonuk. All Rights Reserved. * * Portions created by VMware are Copyright (c) 2007-2012 VMware, Inc. diff --git a/librabbitmq/amqp_socket.h b/librabbitmq/amqp_socket.h index bdeea63..315c4df 100644 --- a/librabbitmq/amqp_socket.h +++ b/librabbitmq/amqp_socket.h @@ -1,6 +1,10 @@ /* vim:set ft=c ts=2 sw=2 sts=2 et cindent: */ /* - * Copyright 2012-2013 Michael Steinert + * Portions created by Alan Antonuk are Copyright (c) 2013-2014 Alan Antonuk. + * All Rights Reserved. + * + * Portions created by Michael Steinert are Copyright (c) 2012-2013 Michael + * Steinert. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), diff --git a/librabbitmq/amqp_ssl_socket.h b/librabbitmq/amqp_ssl_socket.h index 7f8ea64..21a346a 100644 --- a/librabbitmq/amqp_ssl_socket.h +++ b/librabbitmq/amqp_ssl_socket.h @@ -1,7 +1,11 @@ /* vim:set ft=c ts=2 sw=2 sts=2 et cindent: */ /** \file */ /* - * Copyright 2012-2013 Michael Steinert + * Portions created by Alan Antonuk are Copyright (c) 2013-2014 Alan Antonuk. + * All Rights Reserved. + * + * Portions created by Michael Steinert are Copyright (c) 2012-2013 Michael + * Steinert. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), diff --git a/librabbitmq/amqp_tcp_socket.h b/librabbitmq/amqp_tcp_socket.h index 95ed206..7614aa5 100644 --- a/librabbitmq/amqp_tcp_socket.h +++ b/librabbitmq/amqp_tcp_socket.h @@ -1,7 +1,11 @@ /* vim:set ft=c ts=2 sw=2 sts=2 et cindent: */ /** \file */ /* - * Copyright 2012-2013 Michael Steinert + * Portions created by Alan Antonuk are Copyright (c) 2013-2014 Alan Antonuk. + * All Rights Reserved. + * + * Portions created by Michael Steinert are Copyright (c) 2012-2013 Michael + * Steinert. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), diff --git a/librabbitmq/amqp_timer.c b/librabbitmq/amqp_timer.c index 2b41c83..46410dc 100644 --- a/librabbitmq/amqp_timer.c +++ b/librabbitmq/amqp_timer.c @@ -1,6 +1,7 @@ /* vim:set ft=c ts=2 sw=2 sts=2 et cindent: */ /* - * Copyright 2013 Alan Antonuk + * Portions created by Alan Antonuk are Copyright (c) 2013-2014 Alan Antonuk. + * All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), diff --git a/librabbitmq/amqp_timer.h b/librabbitmq/amqp_timer.h index 10254a5..3936922 100644 --- a/librabbitmq/amqp_timer.h +++ b/librabbitmq/amqp_timer.h @@ -1,6 +1,7 @@ /* vim:set ft=c ts=2 sw=2 sts=2 et cindent: */ /* - * Copyright 2013 Alan Antonuk + * Portions created by Alan Antonuk are Copyright (c) 2013-2014 Alan Antonuk. + * All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), diff --git a/librabbitmq/win32/threads.h b/librabbitmq/win32/threads.h index d1de854..9e261ec 100644 --- a/librabbitmq/win32/threads.h +++ b/librabbitmq/win32/threads.h @@ -1,6 +1,10 @@ /* vim:set ft=c ts=2 sw=2 sts=2 et cindent: */ /* - * Copyright 2012-2013 Michael Steinert + * Portions created by Alan Antonuk are Copyright (c) 2013-2014 Alan Antonuk. + * All Rights Reserved. + * + * Portions created by Michael Steinert are Copyright (c) 2012-2013 Michael + * Steinert. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), -- cgit v1.2.1 From 8b448c6a0d073376614928a18eed101092d3044a Mon Sep 17 00:00:00 2001 From: Alan Antonuk Date: Mon, 1 Sep 2014 17:20:07 -0700 Subject: Print message body in amqp[s]_listen[q] examples. This fixes #199. --- README.md | 3 --- examples/amqp_listen.c | 3 +++ examples/amqp_listenq.c | 3 +++ examples/amqps_listen.c | 3 +++ examples/amqps_listenq.c | 3 +++ 5 files changed, 12 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index b7ce488..4f62ce9 100644 --- a/README.md +++ b/README.md @@ -113,9 +113,6 @@ In another terminal, You should see output similar to the following in the listener's terminal window: - Result 1 - Frame type 1, channel 1 - Method AMQP_BASIC_DELIVER_METHOD Delivery 1, exchange amq.direct routingkey test Content-type: text/plain ---- diff --git a/examples/amqp_listen.c b/examples/amqp_listen.c index ca7d538..3f86830 100644 --- a/examples/amqp_listen.c +++ b/examples/amqp_listen.c @@ -126,6 +126,9 @@ int main(int argc, char const *const *argv) (int) envelope.message.properties.content_type.len, (char *) envelope.message.properties.content_type.bytes); } + printf("----\n"); + + amqp_dump(envelope.message.body.bytes, envelope.message.body.len); amqp_destroy_envelope(&envelope); } diff --git a/examples/amqp_listenq.c b/examples/amqp_listenq.c index b2e8094..3735645 100644 --- a/examples/amqp_listenq.c +++ b/examples/amqp_listenq.c @@ -107,6 +107,9 @@ int main(int argc, char const *const *argv) (int) envelope.message.properties.content_type.len, (char *) envelope.message.properties.content_type.bytes); } + printf("----\n"); + + amqp_dump(envelope.message.body.bytes, envelope.message.body.len); amqp_destroy_envelope(&envelope); } diff --git a/examples/amqps_listen.c b/examples/amqps_listen.c index 44bb88c..fe1b86f 100644 --- a/examples/amqps_listen.c +++ b/examples/amqps_listen.c @@ -143,6 +143,9 @@ int main(int argc, char const *const *argv) (int) envelope.message.properties.content_type.len, (char *) envelope.message.properties.content_type.bytes); } + printf("----\n"); + + amqp_dump(envelope.message.body.bytes, envelope.message.body.len); amqp_destroy_envelope(&envelope); } diff --git a/examples/amqps_listenq.c b/examples/amqps_listenq.c index 6643500..b00b50e 100644 --- a/examples/amqps_listenq.c +++ b/examples/amqps_listenq.c @@ -124,6 +124,9 @@ int main(int argc, char const *const *argv) (int) envelope.message.properties.content_type.len, (char *) envelope.message.properties.content_type.bytes); } + printf("----\n"); + + amqp_dump(envelope.message.body.bytes, envelope.message.body.len); amqp_destroy_envelope(&envelope); } -- cgit v1.2.1 From b4eaaa4dca415ece10b9f4c1392b3f1bc6fd6758 Mon Sep 17 00:00:00 2001 From: Alan Antonuk Date: Tue, 2 Sep 2014 19:58:35 -0700 Subject: CMake: check for PKG_CONFIG_FOUND in FindPOPT.cmake --- cmake/FindPOPT.cmake | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cmake/FindPOPT.cmake b/cmake/FindPOPT.cmake index de29c7e..4242875 100644 --- a/cmake/FindPOPT.cmake +++ b/cmake/FindPOPT.cmake @@ -4,13 +4,15 @@ # # POPT_FOUND - System has popt # POPT_INCLUDE_DIR - The popt include directory -# POPT_LIBRARIES - The libraries needed to use popt +# POPT_LIBRARY - The libraries needed to use popt # use pkg-config to get the directories and then use these values # in the FIND_PATH() and FIND_LIBRARY() calls find_package(PkgConfig QUIET) -pkg_search_module(PC_POPT QUIET popt) +if (PKG_CONFIG_FOUND) + pkg_search_module(PC_POPT QUIET popt) +endif () # Find the include directories FIND_PATH(POPT_INCLUDE_DIR -- cgit v1.2.1 From c9f00dfb9f5ce306398f18cafa143988a4f61515 Mon Sep 17 00:00:00 2001 From: Alan Antonuk Date: Tue, 2 Sep 2014 20:49:34 -0700 Subject: Stop CMake warning about @rpath on Mac OS X. --- CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index ae9d98c..f02a2f1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,6 @@ # vim:set ts=2 sw=2 sts=2 et: cmake_minimum_required(VERSION 2.6) +cmake_policy(SET CMP0042 OLD) # Use old @rpath behavior on Mac OSX. project(rabbitmq-c "C") set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake) -- cgit v1.2.1 From 8e0600a65b5d8563ae4091b34307fc03e1000f77 Mon Sep 17 00:00:00 2001 From: Alan Antonuk Date: Tue, 2 Sep 2014 21:08:11 -0700 Subject: Revert "Stop CMake warning about @rpath on Mac OS X." This reverts commit c9f00dfb9f5ce306398f18cafa143988a4f61515. Because it breaks under CMake versions that don't know what CMP0042 is. --- CMakeLists.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f02a2f1..ae9d98c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,5 @@ # vim:set ts=2 sw=2 sts=2 et: cmake_minimum_required(VERSION 2.6) -cmake_policy(SET CMP0042 OLD) # Use old @rpath behavior on Mac OSX. project(rabbitmq-c "C") set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake) -- cgit v1.2.1 From 7188e5dce20e56e43314ed3f9c61c8717f961eff Mon Sep 17 00:00:00 2001 From: Antonio Terceiro Date: Sat, 30 Aug 2014 19:32:13 -0700 Subject: amqp-consume: support consuming N messages at a time MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If you have a single consumer C₁ and 10 messages are published, all 10 will be streamed to that one customer. Assume each message takes a few minutes to be handled. If a second consumer C₂ comes up before C₁ is able to process its first message, it will stay idle until new messages are published, while C₁ will still have to process the other 9 messages after finishing with the first one. If both consumers were started with `--messages 1`, C₁ would only fetch a single message, and start handling it; C₂ would start and already receive the second message . --- tools/consume.c | 27 ++++++++++++++++++++++++--- tools/doc/amqp-consume.xml | 21 +++++++++++++++++++++ 2 files changed, 45 insertions(+), 3 deletions(-) diff --git a/tools/consume.c b/tools/consume.c index 5b7777e..4a0c75d 100644 --- a/tools/consume.c +++ b/tools/consume.c @@ -141,17 +141,32 @@ static amqp_bytes_t setup_queue(amqp_connection_state_t conn, return queue_bytes; } +#define AMQP_CONSUME_MAX_PREFETCH_COUNT 65535 + static void do_consume(amqp_connection_state_t conn, amqp_bytes_t queue, - int no_ack, int count, const char *const *argv) + int no_ack, int count, int prefetch_count, + const char *const *argv) { int i; /* If there is a limit, set the qos to match */ - if (count > 0 && count <= 65535 + if (count > 0 && count <= AMQP_CONSUME_MAX_PREFETCH_COUNT && !amqp_basic_qos(conn, 1, 0, count, 0)) { die_rpc(amqp_get_rpc_reply(conn), "basic.qos"); } + /* if there is a maximum number of messages to be received at a time, set the + * qos to match */ + if (prefetch_count > 0 && prefetch_count <= AMQP_CONSUME_MAX_PREFETCH_COUNT) { + /* the maximum number of messages to be received at a time must be less + * than the global maximum number of messages. */ + if (!(count > 0 && count <= AMQP_CONSUME_MAX_PREFETCH_COUNT && prefetch_count >= count)) { + if (!amqp_basic_qos(conn, 1, 0, prefetch_count, 0)) { + die_rpc(amqp_get_rpc_reply(conn), "basic.qos"); + } + } + } + if (!amqp_basic_consume(conn, 1, queue, amqp_empty_bytes, 0, no_ack, 0, amqp_empty_table)) { die_rpc(amqp_get_rpc_reply(conn), "basic.consume"); @@ -197,6 +212,7 @@ int main(int argc, const char **argv) int exclusive = 0; int no_ack = 0; int count = -1; + int prefetch_count = -1; amqp_bytes_t queue_bytes; struct poptOption options[] = { @@ -230,6 +246,11 @@ int main(int argc, const char **argv) "stop consuming after this many messages are consumed", "limit" }, + { + "prefetch-count", 'p', POPT_ARG_INT, &prefetch_count, 0, + "receive only this many message at a time from the server", + "limit" + }, POPT_AUTOHELP { NULL, '\0', 0, NULL, 0, NULL, NULL } }; @@ -246,7 +267,7 @@ int main(int argc, const char **argv) conn = make_connection(); queue_bytes = setup_queue(conn, queue, exchange, routing_key, declare, exclusive); - do_consume(conn, queue_bytes, no_ack, count, cmd_argv); + do_consume(conn, queue_bytes, no_ack, count, prefetch_count, cmd_argv); close_connection(conn); return 0; diff --git a/tools/doc/amqp-consume.xml b/tools/doc/amqp-consume.xml index f6f51ba..9ee12e8 100644 --- a/tools/doc/amqp-consume.xml +++ b/tools/doc/amqp-consume.xml @@ -160,6 +160,27 @@ + + + =limit + + + Request the server to only send + limit + messages at a time. + + + If any value was passed to , + the value passed to + should be smaller than that, or otherwise it will be + ignored. + + + If / is + passed, this option has no effect. + + + -- cgit v1.2.1 From 2b5d606bca429deed616339f460897aa41819a63 Mon Sep 17 00:00:00 2001 From: Alan Antonuk Date: Sat, 13 Sep 2014 22:12:15 -0700 Subject: Preparation for v0.5.2 release. --- CMakeLists.txt | 2 +- ChangeLog.md | 8 ++++++++ README.md | 6 +++--- configure.ac | 2 +- librabbitmq/amqp.h | 2 +- 5 files changed, 14 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ae9d98c..ffd2295 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,7 +13,7 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake) # 4. If any interfaces have been removed since the last public release, then set age to 0. set(RMQ_SOVERSION_CURRENT 3) -set(RMQ_SOVERSION_REVISION 1) +set(RMQ_SOVERSION_REVISION 2) set(RMQ_SOVERSION_AGE 2) math(EXPR RMQ_SOVERSION_MAJOR "${RMQ_SOVERSION_CURRENT} - ${RMQ_SOVERSION_AGE}") diff --git a/ChangeLog.md b/ChangeLog.md index c19a1c0..6907e76 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -1,4 +1,12 @@ # Change Log +## Changes since v0.5.1 (a.k.a., v0.5.2) +- `fcdf0f8` Autoconf: check for htonll as declaration in a header file +- `5790ec7` SSL: correctly report hostname verification errors. +- `d60c28c` Build: disable OpenSSL deprecation warnings on OSX +- `072191a` Lib: include platform, version and copyright in AMQP handshake +- `8b448c6` Examples: print message body in amqp[s]_listen[q] examples +- `7188e5d` Tools: Add flag to set prefetch for amqp-consume tool + ## Changes since v0.5.0 (a.k.a., v0.5.1) ### Enhancements: - `a566929` SSL: Add support for wildcards in hostname verification (Mike diff --git a/README.md b/README.md index 4f62ce9..d25e2f5 100644 --- a/README.md +++ b/README.md @@ -16,12 +16,12 @@ rabbitmq-discuss mailing list: ## Latest Stable Version -The latest stable release of [rabbitmq-c is v0.5.1](https://github.com/alanxz/rabbitmq-c/releases/tag/v0.5.1). +The latest stable release of [rabbitmq-c is v0.5.2](https://github.com/alanxz/rabbitmq-c/releases/tag/v0.5.2). A complete list of changes can be found in the [Change Log](ChangeLog.md) -The v0.5.0 source tarball can be downloaded from: +The v0.5.2 source tarball can be downloaded from: - + API documentation for v0.5.0+ can viewed from: diff --git a/configure.ac b/configure.ac index 6d465b0..2efd227 100644 --- a/configure.ac +++ b/configure.ac @@ -13,7 +13,7 @@ m4_define([micro_version], [2]) # 3. If any interfaces have been added since the last public release, then increment age. # 4. If any interfaces have been removed since the last public release, then set age to 0. m4_define([soversion_current], [3]) -m4_define([soversion_revision], [1]) +m4_define([soversion_revision], [2]) m4_define([soversion_age], [2]) AC_INIT([rabbitmq-c], [major_version.minor_version.micro_version], diff --git a/librabbitmq/amqp.h b/librabbitmq/amqp.h index b120d83..d85c160 100644 --- a/librabbitmq/amqp.h +++ b/librabbitmq/amqp.h @@ -225,7 +225,7 @@ AMQP_BEGIN_DECLS #define AMQP_VERSION_MAJOR 0 #define AMQP_VERSION_MINOR 5 #define AMQP_VERSION_PATCH 2 -#define AMQP_VERSION_IS_RELEASE 0 +#define AMQP_VERSION_IS_RELEASE 1 /** -- cgit v1.2.1 From 0e9521c6a50004a1df31e9b8494b751236a9b056 Mon Sep 17 00:00:00 2001 From: Alan Antonuk Date: Sat, 13 Sep 2014 22:18:20 -0700 Subject: Bumping revision for development. --- CMakeLists.txt | 2 +- configure.ac | 4 ++-- librabbitmq/amqp.h | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ffd2295..fbfcb05 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,7 +13,7 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake) # 4. If any interfaces have been removed since the last public release, then set age to 0. set(RMQ_SOVERSION_CURRENT 3) -set(RMQ_SOVERSION_REVISION 2) +set(RMQ_SOVERSION_REVISION 3) set(RMQ_SOVERSION_AGE 2) math(EXPR RMQ_SOVERSION_MAJOR "${RMQ_SOVERSION_CURRENT} - ${RMQ_SOVERSION_AGE}") diff --git a/configure.ac b/configure.ac index 2efd227..658f387 100644 --- a/configure.ac +++ b/configure.ac @@ -3,7 +3,7 @@ AC_PREREQ([2.59]) m4_define([major_version], [0]) m4_define([minor_version], [5]) -m4_define([micro_version], [2]) +m4_define([micro_version], [3]) # Follow all steps below in order to calculate new ABI version when updating the library # NOTE: THIS IS UNRELATED to the actual project version @@ -13,7 +13,7 @@ m4_define([micro_version], [2]) # 3. If any interfaces have been added since the last public release, then increment age. # 4. If any interfaces have been removed since the last public release, then set age to 0. m4_define([soversion_current], [3]) -m4_define([soversion_revision], [2]) +m4_define([soversion_revision], [3]) m4_define([soversion_age], [2]) AC_INIT([rabbitmq-c], [major_version.minor_version.micro_version], diff --git a/librabbitmq/amqp.h b/librabbitmq/amqp.h index d85c160..9fcd206 100644 --- a/librabbitmq/amqp.h +++ b/librabbitmq/amqp.h @@ -224,8 +224,8 @@ AMQP_BEGIN_DECLS #define AMQP_VERSION_MAJOR 0 #define AMQP_VERSION_MINOR 5 -#define AMQP_VERSION_PATCH 2 -#define AMQP_VERSION_IS_RELEASE 1 +#define AMQP_VERSION_PATCH 3 +#define AMQP_VERSION_IS_RELEASE 0 /** -- cgit v1.2.1 From 35b63cff12eda35f06e3fec0d4bd3ca341d9a4ea Mon Sep 17 00:00:00 2001 From: Eddy Jansson Date: Tue, 14 Oct 2014 16:36:23 +0200 Subject: Fix spelling in comment for amqp_socket_writev() --- librabbitmq/amqp_socket.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/librabbitmq/amqp_socket.h b/librabbitmq/amqp_socket.h index 315c4df..dad1a1e 100644 --- a/librabbitmq/amqp_socket.h +++ b/librabbitmq/amqp_socket.h @@ -96,7 +96,7 @@ amqp_set_socket(amqp_connection_state_t state, amqp_socket_t *socket); * * This function wraps writev(2) functionality. * - * This function will only reutrn on error, or when all of the bytes referred + * This function will only return on error, or when all of the bytes referred * to in iov have been sent. NOTE: this function may modify the iov struct. * * \param [in,out] self A socket object. -- cgit v1.2.1 From e1746f92585d59364fc48b6305ce25d7fc86c2a4 Mon Sep 17 00:00:00 2001 From: Michael Fladischer Date: Fri, 17 Oct 2014 08:17:47 +0200 Subject: Enable SSL support for tools too. In tools/common.c `#ifdef WITH_SSL` is used but never defined if SSL support is desired. --- tools/CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt index f9b899a..52e3464 100644 --- a/tools/CMakeLists.txt +++ b/tools/CMakeLists.txt @@ -72,6 +72,10 @@ if (BUILD_TOOLS_DOCS) endif(XMLTO_FOUND) endif() +if (ENABLE_SSL_SUPPORT) + add_definitions(-DWITH_SSL=1) +endif() + install(TARGETS amqp-publish amqp-get amqp-consume amqp-declare-queue amqp-delete-queue RUNTIME DESTINATION bin LIBRARY DESTINATION lib -- cgit v1.2.1 From 2340b039f029f3b8101a164d3bcd547be1106906 Mon Sep 17 00:00:00 2001 From: Alan Antonuk Date: Sun, 19 Oct 2014 12:58:19 -0700 Subject: Regen amqp_framing.[ch] to include autogend docs. Doing this because the next change will cause a ton of diffs otherwise. --- librabbitmq/amqp_framing.c | 254 ++++++++++- librabbitmq/amqp_framing.h | 1013 ++++++++++++++++++++++++++++++-------------- 2 files changed, 921 insertions(+), 346 deletions(-) diff --git a/librabbitmq/amqp_framing.c b/librabbitmq/amqp_framing.c index b2f0a83..64c30bb 100644 --- a/librabbitmq/amqp_framing.c +++ b/librabbitmq/amqp_framing.c @@ -1880,7 +1880,16 @@ int amqp_encode_properties(uint16_t class_id, } } -AMQP_PUBLIC_FUNCTION amqp_channel_open_ok_t * AMQP_CALL amqp_channel_open(amqp_connection_state_t state, amqp_channel_t channel) +/** + * amqp_channel_open + * + * @param [in] state connection state + * @param [in] channel the channel to do the RPC on + * @returns amqp_channel_open_ok_t + */ +AMQP_PUBLIC_FUNCTION +amqp_channel_open_ok_t * +AMQP_CALL amqp_channel_open(amqp_connection_state_t state, amqp_channel_t channel) { amqp_channel_open_t req; req.out_of_band = amqp_empty_bytes; @@ -1889,7 +1898,17 @@ AMQP_PUBLIC_FUNCTION amqp_channel_open_ok_t * AMQP_CALL amqp_channel_open(amqp_c } -AMQP_PUBLIC_FUNCTION amqp_channel_flow_ok_t * AMQP_CALL amqp_channel_flow(amqp_connection_state_t state, amqp_channel_t channel, amqp_boolean_t active) +/** + * amqp_channel_flow + * + * @param [in] state connection state + * @param [in] channel the channel to do the RPC on + * @param [in] active active + * @returns amqp_channel_flow_ok_t + */ +AMQP_PUBLIC_FUNCTION +amqp_channel_flow_ok_t * +AMQP_CALL amqp_channel_flow(amqp_connection_state_t state, amqp_channel_t channel, amqp_boolean_t active) { amqp_channel_flow_t req; req.active = active; @@ -1898,7 +1917,21 @@ AMQP_PUBLIC_FUNCTION amqp_channel_flow_ok_t * AMQP_CALL amqp_channel_flow(amqp_c } -AMQP_PUBLIC_FUNCTION amqp_exchange_declare_ok_t * AMQP_CALL amqp_exchange_declare(amqp_connection_state_t state, amqp_channel_t channel, amqp_bytes_t exchange, amqp_bytes_t type, amqp_boolean_t passive, amqp_boolean_t durable, amqp_table_t arguments) +/** + * amqp_exchange_declare + * + * @param [in] state connection state + * @param [in] channel the channel to do the RPC on + * @param [in] exchange exchange + * @param [in] type type + * @param [in] passive passive + * @param [in] durable durable + * @param [in] arguments arguments + * @returns amqp_exchange_declare_ok_t + */ +AMQP_PUBLIC_FUNCTION +amqp_exchange_declare_ok_t * +AMQP_CALL amqp_exchange_declare(amqp_connection_state_t state, amqp_channel_t channel, amqp_bytes_t exchange, amqp_bytes_t type, amqp_boolean_t passive, amqp_boolean_t durable, amqp_table_t arguments) { amqp_exchange_declare_t req; req.ticket = 0; @@ -1915,7 +1948,18 @@ AMQP_PUBLIC_FUNCTION amqp_exchange_declare_ok_t * AMQP_CALL amqp_exchange_declar } -AMQP_PUBLIC_FUNCTION amqp_exchange_delete_ok_t * AMQP_CALL amqp_exchange_delete(amqp_connection_state_t state, amqp_channel_t channel, amqp_bytes_t exchange, amqp_boolean_t if_unused) +/** + * amqp_exchange_delete + * + * @param [in] state connection state + * @param [in] channel the channel to do the RPC on + * @param [in] exchange exchange + * @param [in] if_unused if_unused + * @returns amqp_exchange_delete_ok_t + */ +AMQP_PUBLIC_FUNCTION +amqp_exchange_delete_ok_t * +AMQP_CALL amqp_exchange_delete(amqp_connection_state_t state, amqp_channel_t channel, amqp_bytes_t exchange, amqp_boolean_t if_unused) { amqp_exchange_delete_t req; req.ticket = 0; @@ -1927,7 +1971,20 @@ AMQP_PUBLIC_FUNCTION amqp_exchange_delete_ok_t * AMQP_CALL amqp_exchange_delete( } -AMQP_PUBLIC_FUNCTION amqp_exchange_bind_ok_t * AMQP_CALL amqp_exchange_bind(amqp_connection_state_t state, amqp_channel_t channel, amqp_bytes_t destination, amqp_bytes_t source, amqp_bytes_t routing_key, amqp_table_t arguments) +/** + * amqp_exchange_bind + * + * @param [in] state connection state + * @param [in] channel the channel to do the RPC on + * @param [in] destination destination + * @param [in] source source + * @param [in] routing_key routing_key + * @param [in] arguments arguments + * @returns amqp_exchange_bind_ok_t + */ +AMQP_PUBLIC_FUNCTION +amqp_exchange_bind_ok_t * +AMQP_CALL amqp_exchange_bind(amqp_connection_state_t state, amqp_channel_t channel, amqp_bytes_t destination, amqp_bytes_t source, amqp_bytes_t routing_key, amqp_table_t arguments) { amqp_exchange_bind_t req; req.ticket = 0; @@ -1941,7 +1998,20 @@ AMQP_PUBLIC_FUNCTION amqp_exchange_bind_ok_t * AMQP_CALL amqp_exchange_bind(amqp } -AMQP_PUBLIC_FUNCTION amqp_exchange_unbind_ok_t * AMQP_CALL amqp_exchange_unbind(amqp_connection_state_t state, amqp_channel_t channel, amqp_bytes_t destination, amqp_bytes_t source, amqp_bytes_t routing_key, amqp_table_t arguments) +/** + * amqp_exchange_unbind + * + * @param [in] state connection state + * @param [in] channel the channel to do the RPC on + * @param [in] destination destination + * @param [in] source source + * @param [in] routing_key routing_key + * @param [in] arguments arguments + * @returns amqp_exchange_unbind_ok_t + */ +AMQP_PUBLIC_FUNCTION +amqp_exchange_unbind_ok_t * +AMQP_CALL amqp_exchange_unbind(amqp_connection_state_t state, amqp_channel_t channel, amqp_bytes_t destination, amqp_bytes_t source, amqp_bytes_t routing_key, amqp_table_t arguments) { amqp_exchange_unbind_t req; req.ticket = 0; @@ -1955,7 +2025,22 @@ AMQP_PUBLIC_FUNCTION amqp_exchange_unbind_ok_t * AMQP_CALL amqp_exchange_unbind( } -AMQP_PUBLIC_FUNCTION amqp_queue_declare_ok_t * AMQP_CALL amqp_queue_declare(amqp_connection_state_t state, amqp_channel_t channel, amqp_bytes_t queue, amqp_boolean_t passive, amqp_boolean_t durable, amqp_boolean_t exclusive, amqp_boolean_t auto_delete, amqp_table_t arguments) +/** + * amqp_queue_declare + * + * @param [in] state connection state + * @param [in] channel the channel to do the RPC on + * @param [in] queue queue + * @param [in] passive passive + * @param [in] durable durable + * @param [in] exclusive exclusive + * @param [in] auto_delete auto_delete + * @param [in] arguments arguments + * @returns amqp_queue_declare_ok_t + */ +AMQP_PUBLIC_FUNCTION +amqp_queue_declare_ok_t * +AMQP_CALL amqp_queue_declare(amqp_connection_state_t state, amqp_channel_t channel, amqp_bytes_t queue, amqp_boolean_t passive, amqp_boolean_t durable, amqp_boolean_t exclusive, amqp_boolean_t auto_delete, amqp_table_t arguments) { amqp_queue_declare_t req; req.ticket = 0; @@ -1971,7 +2056,20 @@ AMQP_PUBLIC_FUNCTION amqp_queue_declare_ok_t * AMQP_CALL amqp_queue_declare(amqp } -AMQP_PUBLIC_FUNCTION amqp_queue_bind_ok_t * AMQP_CALL amqp_queue_bind(amqp_connection_state_t state, amqp_channel_t channel, amqp_bytes_t queue, amqp_bytes_t exchange, amqp_bytes_t routing_key, amqp_table_t arguments) +/** + * amqp_queue_bind + * + * @param [in] state connection state + * @param [in] channel the channel to do the RPC on + * @param [in] queue queue + * @param [in] exchange exchange + * @param [in] routing_key routing_key + * @param [in] arguments arguments + * @returns amqp_queue_bind_ok_t + */ +AMQP_PUBLIC_FUNCTION +amqp_queue_bind_ok_t * +AMQP_CALL amqp_queue_bind(amqp_connection_state_t state, amqp_channel_t channel, amqp_bytes_t queue, amqp_bytes_t exchange, amqp_bytes_t routing_key, amqp_table_t arguments) { amqp_queue_bind_t req; req.ticket = 0; @@ -1985,7 +2083,17 @@ AMQP_PUBLIC_FUNCTION amqp_queue_bind_ok_t * AMQP_CALL amqp_queue_bind(amqp_conne } -AMQP_PUBLIC_FUNCTION amqp_queue_purge_ok_t * AMQP_CALL amqp_queue_purge(amqp_connection_state_t state, amqp_channel_t channel, amqp_bytes_t queue) +/** + * amqp_queue_purge + * + * @param [in] state connection state + * @param [in] channel the channel to do the RPC on + * @param [in] queue queue + * @returns amqp_queue_purge_ok_t + */ +AMQP_PUBLIC_FUNCTION +amqp_queue_purge_ok_t * +AMQP_CALL amqp_queue_purge(amqp_connection_state_t state, amqp_channel_t channel, amqp_bytes_t queue) { amqp_queue_purge_t req; req.ticket = 0; @@ -1996,7 +2104,19 @@ AMQP_PUBLIC_FUNCTION amqp_queue_purge_ok_t * AMQP_CALL amqp_queue_purge(amqp_con } -AMQP_PUBLIC_FUNCTION amqp_queue_delete_ok_t * AMQP_CALL amqp_queue_delete(amqp_connection_state_t state, amqp_channel_t channel, amqp_bytes_t queue, amqp_boolean_t if_unused, amqp_boolean_t if_empty) +/** + * amqp_queue_delete + * + * @param [in] state connection state + * @param [in] channel the channel to do the RPC on + * @param [in] queue queue + * @param [in] if_unused if_unused + * @param [in] if_empty if_empty + * @returns amqp_queue_delete_ok_t + */ +AMQP_PUBLIC_FUNCTION +amqp_queue_delete_ok_t * +AMQP_CALL amqp_queue_delete(amqp_connection_state_t state, amqp_channel_t channel, amqp_bytes_t queue, amqp_boolean_t if_unused, amqp_boolean_t if_empty) { amqp_queue_delete_t req; req.ticket = 0; @@ -2009,7 +2129,20 @@ AMQP_PUBLIC_FUNCTION amqp_queue_delete_ok_t * AMQP_CALL amqp_queue_delete(amqp_c } -AMQP_PUBLIC_FUNCTION amqp_queue_unbind_ok_t * AMQP_CALL amqp_queue_unbind(amqp_connection_state_t state, amqp_channel_t channel, amqp_bytes_t queue, amqp_bytes_t exchange, amqp_bytes_t routing_key, amqp_table_t arguments) +/** + * amqp_queue_unbind + * + * @param [in] state connection state + * @param [in] channel the channel to do the RPC on + * @param [in] queue queue + * @param [in] exchange exchange + * @param [in] routing_key routing_key + * @param [in] arguments arguments + * @returns amqp_queue_unbind_ok_t + */ +AMQP_PUBLIC_FUNCTION +amqp_queue_unbind_ok_t * +AMQP_CALL amqp_queue_unbind(amqp_connection_state_t state, amqp_channel_t channel, amqp_bytes_t queue, amqp_bytes_t exchange, amqp_bytes_t routing_key, amqp_table_t arguments) { amqp_queue_unbind_t req; req.ticket = 0; @@ -2022,7 +2155,19 @@ AMQP_PUBLIC_FUNCTION amqp_queue_unbind_ok_t * AMQP_CALL amqp_queue_unbind(amqp_c } -AMQP_PUBLIC_FUNCTION amqp_basic_qos_ok_t * AMQP_CALL amqp_basic_qos(amqp_connection_state_t state, amqp_channel_t channel, uint32_t prefetch_size, uint16_t prefetch_count, amqp_boolean_t global) +/** + * amqp_basic_qos + * + * @param [in] state connection state + * @param [in] channel the channel to do the RPC on + * @param [in] prefetch_size prefetch_size + * @param [in] prefetch_count prefetch_count + * @param [in] global global + * @returns amqp_basic_qos_ok_t + */ +AMQP_PUBLIC_FUNCTION +amqp_basic_qos_ok_t * +AMQP_CALL amqp_basic_qos(amqp_connection_state_t state, amqp_channel_t channel, uint32_t prefetch_size, uint16_t prefetch_count, amqp_boolean_t global) { amqp_basic_qos_t req; req.prefetch_size = prefetch_size; @@ -2033,7 +2178,22 @@ AMQP_PUBLIC_FUNCTION amqp_basic_qos_ok_t * AMQP_CALL amqp_basic_qos(amqp_connect } -AMQP_PUBLIC_FUNCTION amqp_basic_consume_ok_t * AMQP_CALL amqp_basic_consume(amqp_connection_state_t state, amqp_channel_t channel, amqp_bytes_t queue, amqp_bytes_t consumer_tag, amqp_boolean_t no_local, amqp_boolean_t no_ack, amqp_boolean_t exclusive, amqp_table_t arguments) +/** + * amqp_basic_consume + * + * @param [in] state connection state + * @param [in] channel the channel to do the RPC on + * @param [in] queue queue + * @param [in] consumer_tag consumer_tag + * @param [in] no_local no_local + * @param [in] no_ack no_ack + * @param [in] exclusive exclusive + * @param [in] arguments arguments + * @returns amqp_basic_consume_ok_t + */ +AMQP_PUBLIC_FUNCTION +amqp_basic_consume_ok_t * +AMQP_CALL amqp_basic_consume(amqp_connection_state_t state, amqp_channel_t channel, amqp_bytes_t queue, amqp_bytes_t consumer_tag, amqp_boolean_t no_local, amqp_boolean_t no_ack, amqp_boolean_t exclusive, amqp_table_t arguments) { amqp_basic_consume_t req; req.ticket = 0; @@ -2049,7 +2209,17 @@ AMQP_PUBLIC_FUNCTION amqp_basic_consume_ok_t * AMQP_CALL amqp_basic_consume(amqp } -AMQP_PUBLIC_FUNCTION amqp_basic_cancel_ok_t * AMQP_CALL amqp_basic_cancel(amqp_connection_state_t state, amqp_channel_t channel, amqp_bytes_t consumer_tag) +/** + * amqp_basic_cancel + * + * @param [in] state connection state + * @param [in] channel the channel to do the RPC on + * @param [in] consumer_tag consumer_tag + * @returns amqp_basic_cancel_ok_t + */ +AMQP_PUBLIC_FUNCTION +amqp_basic_cancel_ok_t * +AMQP_CALL amqp_basic_cancel(amqp_connection_state_t state, amqp_channel_t channel, amqp_bytes_t consumer_tag) { amqp_basic_cancel_t req; req.consumer_tag = consumer_tag; @@ -2059,7 +2229,17 @@ AMQP_PUBLIC_FUNCTION amqp_basic_cancel_ok_t * AMQP_CALL amqp_basic_cancel(amqp_c } -AMQP_PUBLIC_FUNCTION amqp_basic_recover_ok_t * AMQP_CALL amqp_basic_recover(amqp_connection_state_t state, amqp_channel_t channel, amqp_boolean_t requeue) +/** + * amqp_basic_recover + * + * @param [in] state connection state + * @param [in] channel the channel to do the RPC on + * @param [in] requeue requeue + * @returns amqp_basic_recover_ok_t + */ +AMQP_PUBLIC_FUNCTION +amqp_basic_recover_ok_t * +AMQP_CALL amqp_basic_recover(amqp_connection_state_t state, amqp_channel_t channel, amqp_boolean_t requeue) { amqp_basic_recover_t req; req.requeue = requeue; @@ -2068,7 +2248,16 @@ AMQP_PUBLIC_FUNCTION amqp_basic_recover_ok_t * AMQP_CALL amqp_basic_recover(amqp } -AMQP_PUBLIC_FUNCTION amqp_tx_select_ok_t * AMQP_CALL amqp_tx_select(amqp_connection_state_t state, amqp_channel_t channel) +/** + * amqp_tx_select + * + * @param [in] state connection state + * @param [in] channel the channel to do the RPC on + * @returns amqp_tx_select_ok_t + */ +AMQP_PUBLIC_FUNCTION +amqp_tx_select_ok_t * +AMQP_CALL amqp_tx_select(amqp_connection_state_t state, amqp_channel_t channel) { amqp_tx_select_t req; @@ -2076,7 +2265,16 @@ AMQP_PUBLIC_FUNCTION amqp_tx_select_ok_t * AMQP_CALL amqp_tx_select(amqp_connect } -AMQP_PUBLIC_FUNCTION amqp_tx_commit_ok_t * AMQP_CALL amqp_tx_commit(amqp_connection_state_t state, amqp_channel_t channel) +/** + * amqp_tx_commit + * + * @param [in] state connection state + * @param [in] channel the channel to do the RPC on + * @returns amqp_tx_commit_ok_t + */ +AMQP_PUBLIC_FUNCTION +amqp_tx_commit_ok_t * +AMQP_CALL amqp_tx_commit(amqp_connection_state_t state, amqp_channel_t channel) { amqp_tx_commit_t req; @@ -2084,7 +2282,16 @@ AMQP_PUBLIC_FUNCTION amqp_tx_commit_ok_t * AMQP_CALL amqp_tx_commit(amqp_connect } -AMQP_PUBLIC_FUNCTION amqp_tx_rollback_ok_t * AMQP_CALL amqp_tx_rollback(amqp_connection_state_t state, amqp_channel_t channel) +/** + * amqp_tx_rollback + * + * @param [in] state connection state + * @param [in] channel the channel to do the RPC on + * @returns amqp_tx_rollback_ok_t + */ +AMQP_PUBLIC_FUNCTION +amqp_tx_rollback_ok_t * +AMQP_CALL amqp_tx_rollback(amqp_connection_state_t state, amqp_channel_t channel) { amqp_tx_rollback_t req; @@ -2092,7 +2299,16 @@ AMQP_PUBLIC_FUNCTION amqp_tx_rollback_ok_t * AMQP_CALL amqp_tx_rollback(amqp_con } -AMQP_PUBLIC_FUNCTION amqp_confirm_select_ok_t * AMQP_CALL amqp_confirm_select(amqp_connection_state_t state, amqp_channel_t channel) +/** + * amqp_confirm_select + * + * @param [in] state connection state + * @param [in] channel the channel to do the RPC on + * @returns amqp_confirm_select_ok_t + */ +AMQP_PUBLIC_FUNCTION +amqp_confirm_select_ok_t * +AMQP_CALL amqp_confirm_select(amqp_connection_state_t state, amqp_channel_t channel) { amqp_confirm_select_t req; req.nowait = 0; diff --git a/librabbitmq/amqp_framing.h b/librabbitmq/amqp_framing.h index 0c04cb8..1179012 100644 --- a/librabbitmq/amqp_framing.h +++ b/librabbitmq/amqp_framing.h @@ -34,6 +34,7 @@ * ***** END LICENSE BLOCK ***** */ +/** @file amqp_framing.h */ #ifndef AMQP_FRAMING_H #define AMQP_FRAMING_H @@ -41,54 +42,95 @@ AMQP_BEGIN_DECLS -#define AMQP_PROTOCOL_VERSION_MAJOR 0 -#define AMQP_PROTOCOL_VERSION_MINOR 9 -#define AMQP_PROTOCOL_VERSION_REVISION 1 -#define AMQP_PROTOCOL_PORT 5672 -#define AMQP_FRAME_METHOD 1 -#define AMQP_FRAME_HEADER 2 -#define AMQP_FRAME_BODY 3 -#define AMQP_FRAME_HEARTBEAT 8 -#define AMQP_FRAME_MIN_SIZE 4096 -#define AMQP_FRAME_END 206 -#define AMQP_REPLY_SUCCESS 200 -#define AMQP_CONTENT_TOO_LARGE 311 -#define AMQP_NO_ROUTE 312 -#define AMQP_NO_CONSUMERS 313 -#define AMQP_ACCESS_REFUSED 403 -#define AMQP_NOT_FOUND 404 -#define AMQP_RESOURCE_LOCKED 405 -#define AMQP_PRECONDITION_FAILED 406 -#define AMQP_CONNECTION_FORCED 320 -#define AMQP_INVALID_PATH 402 -#define AMQP_FRAME_ERROR 501 -#define AMQP_SYNTAX_ERROR 502 -#define AMQP_COMMAND_INVALID 503 -#define AMQP_CHANNEL_ERROR 504 -#define AMQP_UNEXPECTED_FRAME 505 -#define AMQP_RESOURCE_ERROR 506 -#define AMQP_NOT_ALLOWED 530 -#define AMQP_NOT_IMPLEMENTED 540 -#define AMQP_INTERNAL_ERROR 541 +#define AMQP_PROTOCOL_VERSION_MAJOR 0 /**< AMQP protocol version major */ +#define AMQP_PROTOCOL_VERSION_MINOR 9 /**< AMQP protocol version minor */ +#define AMQP_PROTOCOL_VERSION_REVISION 1 /**< AMQP protocol version revision */ +#define AMQP_PROTOCOL_PORT 5672 /**< Default AMQP Port */ +#define AMQP_FRAME_METHOD 1 /**< Constant: FRAME-METHOD */ +#define AMQP_FRAME_HEADER 2 /**< Constant: FRAME-HEADER */ +#define AMQP_FRAME_BODY 3 /**< Constant: FRAME-BODY */ +#define AMQP_FRAME_HEARTBEAT 8 /**< Constant: FRAME-HEARTBEAT */ +#define AMQP_FRAME_MIN_SIZE 4096 /**< Constant: FRAME-MIN-SIZE */ +#define AMQP_FRAME_END 206 /**< Constant: FRAME-END */ +#define AMQP_REPLY_SUCCESS 200 /**< Constant: REPLY-SUCCESS */ +#define AMQP_CONTENT_TOO_LARGE 311 /**< Constant: CONTENT-TOO-LARGE */ +#define AMQP_NO_ROUTE 312 /**< Constant: NO-ROUTE */ +#define AMQP_NO_CONSUMERS 313 /**< Constant: NO-CONSUMERS */ +#define AMQP_ACCESS_REFUSED 403 /**< Constant: ACCESS-REFUSED */ +#define AMQP_NOT_FOUND 404 /**< Constant: NOT-FOUND */ +#define AMQP_RESOURCE_LOCKED 405 /**< Constant: RESOURCE-LOCKED */ +#define AMQP_PRECONDITION_FAILED 406 /**< Constant: PRECONDITION-FAILED */ +#define AMQP_CONNECTION_FORCED 320 /**< Constant: CONNECTION-FORCED */ +#define AMQP_INVALID_PATH 402 /**< Constant: INVALID-PATH */ +#define AMQP_FRAME_ERROR 501 /**< Constant: FRAME-ERROR */ +#define AMQP_SYNTAX_ERROR 502 /**< Constant: SYNTAX-ERROR */ +#define AMQP_COMMAND_INVALID 503 /**< Constant: COMMAND-INVALID */ +#define AMQP_CHANNEL_ERROR 504 /**< Constant: CHANNEL-ERROR */ +#define AMQP_UNEXPECTED_FRAME 505 /**< Constant: UNEXPECTED-FRAME */ +#define AMQP_RESOURCE_ERROR 506 /**< Constant: RESOURCE-ERROR */ +#define AMQP_NOT_ALLOWED 530 /**< Constant: NOT-ALLOWED */ +#define AMQP_NOT_IMPLEMENTED 540 /**< Constant: NOT-IMPLEMENTED */ +#define AMQP_INTERNAL_ERROR 541 /**< Constant: INTERNAL-ERROR */ /* Function prototypes. */ +/** + * Get constant name string from constant + * + * @param [in] constantNumber constant to get the name of + * @returns string describing the constant. String is managed by + * the library and should not be free()'d by the program + */ AMQP_PUBLIC_FUNCTION char const * AMQP_CALL amqp_constant_name(int constantNumber); +/** + * Checks to see if a constant is a hard error + * + * A hard error occurs when something severe enough + * happens that the connection must be closed. + * + * @param [in] constantNumber the error constant + * @returns true if its a hard error, false otherwise + */ AMQP_PUBLIC_FUNCTION amqp_boolean_t AMQP_CALL amqp_constant_is_hard_error(int constantNumber); +/** + * Get method name string from method number + * + * @param [in] methodNumber the method number + * @returns method name string. String is managed by the library + * and should not be freed()'d by the program + */ AMQP_PUBLIC_FUNCTION char const * AMQP_CALL amqp_method_name(amqp_method_number_t methodNumber); +/** + * Check whether a method has content + * + * A method that has content will receive the method frame + * a properties frame, then 1 to N body frames + * + * @param [in] methodNumber the method number + * @returns true if method has content, false otherwise + */ AMQP_PUBLIC_FUNCTION amqp_boolean_t AMQP_CALL amqp_method_has_content(amqp_method_number_t methodNumber); +/** + * Decodes a method from AMQP wireformat + * + * @param [in] methodNumber the method number for the decoded parameter + * @param [in] pool the memory pool to allocate the decoded method from + * @param [in] encoded the encoded byte string buffer + * @param [out] decoded pointer to the decoded method struct + * @returns 0 on success, an error code otherwise + */ AMQP_PUBLIC_FUNCTION int AMQP_CALL amqp_decode_method(amqp_method_number_t methodNumber, @@ -96,6 +138,15 @@ AMQP_CALL amqp_decode_method(amqp_method_number_t methodNumber, amqp_bytes_t encoded, void **decoded); +/** + * Decodes a header frame properties structure from AMQP wireformat + * + * @param [in] class_id the class id for the decoded parameter + * @param [in] pool the memory pool to allocate the decoded properties from + * @param [in] encoded the encoded byte string buffer + * @param [out] decoded pointer to the decoded properties struct + * @returns 0 on success, an error code otherwise + */ AMQP_PUBLIC_FUNCTION int AMQP_CALL amqp_decode_properties(uint16_t class_id, @@ -103,12 +154,32 @@ AMQP_CALL amqp_decode_properties(uint16_t class_id, amqp_bytes_t encoded, void **decoded); +/** + * Encodes a method structure in AMQP wireformat + * + * @param [in] methodNumber the method number for the decoded parameter + * @param [in] decoded the method structure (e.g., amqp_connection_start_t) + * @param [in] encoded an allocated byte buffer for the encoded method + * structure to be written to. If the buffer isn't large enough + * to hold the encoded method, an error code will be returned. + * @returns 0 on success, an error code otherwise. + */ AMQP_PUBLIC_FUNCTION int AMQP_CALL amqp_encode_method(amqp_method_number_t methodNumber, void *decoded, amqp_bytes_t encoded); +/** + * Encodes a properties structure in AMQP wireformat + * + * @param [in] class_id the class id for the decoded parameter + * @param [in] decoded the properties structure (e.g., amqp_basic_properties_t) + * @param [in] encoded an allocated byte buffer for the encoded properties to written to. + * If the buffer isn't large enough to hold the encoded method, an + * an error code will be returned + * @returns 0 on success, an error code otherwise. + */ AMQP_PUBLIC_FUNCTION int AMQP_CALL amqp_encode_properties(uint16_t class_id, @@ -117,523 +188,811 @@ AMQP_CALL amqp_encode_properties(uint16_t class_id, /* Method field records. */ -#define AMQP_CONNECTION_START_METHOD ((amqp_method_number_t) 0x000A000A) /* 10, 10; 655370 */ +#define AMQP_CONNECTION_START_METHOD ((amqp_method_number_t) 0x000A000A) /**< connection.start method id @internal 10, 10; 655370 */ +/** connection.start method fields */ typedef struct amqp_connection_start_t_ { - uint8_t version_major; - uint8_t version_minor; - amqp_table_t server_properties; - amqp_bytes_t mechanisms; - amqp_bytes_t locales; + uint8_t version_major; /**< version-major */ + uint8_t version_minor; /**< version-minor */ + amqp_table_t server_properties; /**< server-properties */ + amqp_bytes_t mechanisms; /**< mechanisms */ + amqp_bytes_t locales; /**< locales */ } amqp_connection_start_t; -#define AMQP_CONNECTION_START_OK_METHOD ((amqp_method_number_t) 0x000A000B) /* 10, 11; 655371 */ +#define AMQP_CONNECTION_START_OK_METHOD ((amqp_method_number_t) 0x000A000B) /**< connection.start-ok method id @internal 10, 11; 655371 */ +/** connection.start-ok method fields */ typedef struct amqp_connection_start_ok_t_ { - amqp_table_t client_properties; - amqp_bytes_t mechanism; - amqp_bytes_t response; - amqp_bytes_t locale; + amqp_table_t client_properties; /**< client-properties */ + amqp_bytes_t mechanism; /**< mechanism */ + amqp_bytes_t response; /**< response */ + amqp_bytes_t locale; /**< locale */ } amqp_connection_start_ok_t; -#define AMQP_CONNECTION_SECURE_METHOD ((amqp_method_number_t) 0x000A0014) /* 10, 20; 655380 */ +#define AMQP_CONNECTION_SECURE_METHOD ((amqp_method_number_t) 0x000A0014) /**< connection.secure method id @internal 10, 20; 655380 */ +/** connection.secure method fields */ typedef struct amqp_connection_secure_t_ { - amqp_bytes_t challenge; + amqp_bytes_t challenge; /**< challenge */ } amqp_connection_secure_t; -#define AMQP_CONNECTION_SECURE_OK_METHOD ((amqp_method_number_t) 0x000A0015) /* 10, 21; 655381 */ +#define AMQP_CONNECTION_SECURE_OK_METHOD ((amqp_method_number_t) 0x000A0015) /**< connection.secure-ok method id @internal 10, 21; 655381 */ +/** connection.secure-ok method fields */ typedef struct amqp_connection_secure_ok_t_ { - amqp_bytes_t response; + amqp_bytes_t response; /**< response */ } amqp_connection_secure_ok_t; -#define AMQP_CONNECTION_TUNE_METHOD ((amqp_method_number_t) 0x000A001E) /* 10, 30; 655390 */ +#define AMQP_CONNECTION_TUNE_METHOD ((amqp_method_number_t) 0x000A001E) /**< connection.tune method id @internal 10, 30; 655390 */ +/** connection.tune method fields */ typedef struct amqp_connection_tune_t_ { - uint16_t channel_max; - uint32_t frame_max; - uint16_t heartbeat; + uint16_t channel_max; /**< channel-max */ + uint32_t frame_max; /**< frame-max */ + uint16_t heartbeat; /**< heartbeat */ } amqp_connection_tune_t; -#define AMQP_CONNECTION_TUNE_OK_METHOD ((amqp_method_number_t) 0x000A001F) /* 10, 31; 655391 */ +#define AMQP_CONNECTION_TUNE_OK_METHOD ((amqp_method_number_t) 0x000A001F) /**< connection.tune-ok method id @internal 10, 31; 655391 */ +/** connection.tune-ok method fields */ typedef struct amqp_connection_tune_ok_t_ { - uint16_t channel_max; - uint32_t frame_max; - uint16_t heartbeat; + uint16_t channel_max; /**< channel-max */ + uint32_t frame_max; /**< frame-max */ + uint16_t heartbeat; /**< heartbeat */ } amqp_connection_tune_ok_t; -#define AMQP_CONNECTION_OPEN_METHOD ((amqp_method_number_t) 0x000A0028) /* 10, 40; 655400 */ +#define AMQP_CONNECTION_OPEN_METHOD ((amqp_method_number_t) 0x000A0028) /**< connection.open method id @internal 10, 40; 655400 */ +/** connection.open method fields */ typedef struct amqp_connection_open_t_ { - amqp_bytes_t virtual_host; - amqp_bytes_t capabilities; - amqp_boolean_t insist; + amqp_bytes_t virtual_host; /**< virtual-host */ + amqp_bytes_t capabilities; /**< capabilities */ + amqp_boolean_t insist; /**< insist */ } amqp_connection_open_t; -#define AMQP_CONNECTION_OPEN_OK_METHOD ((amqp_method_number_t) 0x000A0029) /* 10, 41; 655401 */ +#define AMQP_CONNECTION_OPEN_OK_METHOD ((amqp_method_number_t) 0x000A0029) /**< connection.open-ok method id @internal 10, 41; 655401 */ +/** connection.open-ok method fields */ typedef struct amqp_connection_open_ok_t_ { - amqp_bytes_t known_hosts; + amqp_bytes_t known_hosts; /**< known-hosts */ } amqp_connection_open_ok_t; -#define AMQP_CONNECTION_CLOSE_METHOD ((amqp_method_number_t) 0x000A0032) /* 10, 50; 655410 */ +#define AMQP_CONNECTION_CLOSE_METHOD ((amqp_method_number_t) 0x000A0032) /**< connection.close method id @internal 10, 50; 655410 */ +/** connection.close method fields */ typedef struct amqp_connection_close_t_ { - uint16_t reply_code; - amqp_bytes_t reply_text; - uint16_t class_id; - uint16_t method_id; + uint16_t reply_code; /**< reply-code */ + amqp_bytes_t reply_text; /**< reply-text */ + uint16_t class_id; /**< class-id */ + uint16_t method_id; /**< method-id */ } amqp_connection_close_t; -#define AMQP_CONNECTION_CLOSE_OK_METHOD ((amqp_method_number_t) 0x000A0033) /* 10, 51; 655411 */ +#define AMQP_CONNECTION_CLOSE_OK_METHOD ((amqp_method_number_t) 0x000A0033) /**< connection.close-ok method id @internal 10, 51; 655411 */ +/** connection.close-ok method fields */ typedef struct amqp_connection_close_ok_t_ { - char dummy; /* Dummy field to avoid empty struct */ + char dummy; /**< Dummy field to avoid empty struct */ } amqp_connection_close_ok_t; -#define AMQP_CONNECTION_BLOCKED_METHOD ((amqp_method_number_t) 0x000A003C) /* 10, 60; 655420 */ +#define AMQP_CONNECTION_BLOCKED_METHOD ((amqp_method_number_t) 0x000A003C) /**< connection.blocked method id @internal 10, 60; 655420 */ +/** connection.blocked method fields */ typedef struct amqp_connection_blocked_t_ { - amqp_bytes_t reason; + amqp_bytes_t reason; /**< reason */ } amqp_connection_blocked_t; -#define AMQP_CONNECTION_UNBLOCKED_METHOD ((amqp_method_number_t) 0x000A003D) /* 10, 61; 655421 */ +#define AMQP_CONNECTION_UNBLOCKED_METHOD ((amqp_method_number_t) 0x000A003D) /**< connection.unblocked method id @internal 10, 61; 655421 */ +/** connection.unblocked method fields */ typedef struct amqp_connection_unblocked_t_ { - char dummy; /* Dummy field to avoid empty struct */ + char dummy; /**< Dummy field to avoid empty struct */ } amqp_connection_unblocked_t; -#define AMQP_CHANNEL_OPEN_METHOD ((amqp_method_number_t) 0x0014000A) /* 20, 10; 1310730 */ +#define AMQP_CHANNEL_OPEN_METHOD ((amqp_method_number_t) 0x0014000A) /**< channel.open method id @internal 20, 10; 1310730 */ +/** channel.open method fields */ typedef struct amqp_channel_open_t_ { - amqp_bytes_t out_of_band; + amqp_bytes_t out_of_band; /**< out-of-band */ } amqp_channel_open_t; -#define AMQP_CHANNEL_OPEN_OK_METHOD ((amqp_method_number_t) 0x0014000B) /* 20, 11; 1310731 */ +#define AMQP_CHANNEL_OPEN_OK_METHOD ((amqp_method_number_t) 0x0014000B) /**< channel.open-ok method id @internal 20, 11; 1310731 */ +/** channel.open-ok method fields */ typedef struct amqp_channel_open_ok_t_ { - amqp_bytes_t channel_id; + amqp_bytes_t channel_id; /**< channel-id */ } amqp_channel_open_ok_t; -#define AMQP_CHANNEL_FLOW_METHOD ((amqp_method_number_t) 0x00140014) /* 20, 20; 1310740 */ +#define AMQP_CHANNEL_FLOW_METHOD ((amqp_method_number_t) 0x00140014) /**< channel.flow method id @internal 20, 20; 1310740 */ +/** channel.flow method fields */ typedef struct amqp_channel_flow_t_ { - amqp_boolean_t active; + amqp_boolean_t active; /**< active */ } amqp_channel_flow_t; -#define AMQP_CHANNEL_FLOW_OK_METHOD ((amqp_method_number_t) 0x00140015) /* 20, 21; 1310741 */ +#define AMQP_CHANNEL_FLOW_OK_METHOD ((amqp_method_number_t) 0x00140015) /**< channel.flow-ok method id @internal 20, 21; 1310741 */ +/** channel.flow-ok method fields */ typedef struct amqp_channel_flow_ok_t_ { - amqp_boolean_t active; + amqp_boolean_t active; /**< active */ } amqp_channel_flow_ok_t; -#define AMQP_CHANNEL_CLOSE_METHOD ((amqp_method_number_t) 0x00140028) /* 20, 40; 1310760 */ +#define AMQP_CHANNEL_CLOSE_METHOD ((amqp_method_number_t) 0x00140028) /**< channel.close method id @internal 20, 40; 1310760 */ +/** channel.close method fields */ typedef struct amqp_channel_close_t_ { - uint16_t reply_code; - amqp_bytes_t reply_text; - uint16_t class_id; - uint16_t method_id; + uint16_t reply_code; /**< reply-code */ + amqp_bytes_t reply_text; /**< reply-text */ + uint16_t class_id; /**< class-id */ + uint16_t method_id; /**< method-id */ } amqp_channel_close_t; -#define AMQP_CHANNEL_CLOSE_OK_METHOD ((amqp_method_number_t) 0x00140029) /* 20, 41; 1310761 */ +#define AMQP_CHANNEL_CLOSE_OK_METHOD ((amqp_method_number_t) 0x00140029) /**< channel.close-ok method id @internal 20, 41; 1310761 */ +/** channel.close-ok method fields */ typedef struct amqp_channel_close_ok_t_ { - char dummy; /* Dummy field to avoid empty struct */ + char dummy; /**< Dummy field to avoid empty struct */ } amqp_channel_close_ok_t; -#define AMQP_ACCESS_REQUEST_METHOD ((amqp_method_number_t) 0x001E000A) /* 30, 10; 1966090 */ +#define AMQP_ACCESS_REQUEST_METHOD ((amqp_method_number_t) 0x001E000A) /**< access.request method id @internal 30, 10; 1966090 */ +/** access.request method fields */ typedef struct amqp_access_request_t_ { - amqp_bytes_t realm; - amqp_boolean_t exclusive; - amqp_boolean_t passive; - amqp_boolean_t active; - amqp_boolean_t write; - amqp_boolean_t read; + amqp_bytes_t realm; /**< realm */ + amqp_boolean_t exclusive; /**< exclusive */ + amqp_boolean_t passive; /**< passive */ + amqp_boolean_t active; /**< active */ + amqp_boolean_t write; /**< write */ + amqp_boolean_t read; /**< read */ } amqp_access_request_t; -#define AMQP_ACCESS_REQUEST_OK_METHOD ((amqp_method_number_t) 0x001E000B) /* 30, 11; 1966091 */ +#define AMQP_ACCESS_REQUEST_OK_METHOD ((amqp_method_number_t) 0x001E000B) /**< access.request-ok method id @internal 30, 11; 1966091 */ +/** access.request-ok method fields */ typedef struct amqp_access_request_ok_t_ { - uint16_t ticket; + uint16_t ticket; /**< ticket */ } amqp_access_request_ok_t; -#define AMQP_EXCHANGE_DECLARE_METHOD ((amqp_method_number_t) 0x0028000A) /* 40, 10; 2621450 */ +#define AMQP_EXCHANGE_DECLARE_METHOD ((amqp_method_number_t) 0x0028000A) /**< exchange.declare method id @internal 40, 10; 2621450 */ +/** exchange.declare method fields */ typedef struct amqp_exchange_declare_t_ { - uint16_t ticket; - amqp_bytes_t exchange; - amqp_bytes_t type; - amqp_boolean_t passive; - amqp_boolean_t durable; - amqp_boolean_t auto_delete; - amqp_boolean_t internal; - amqp_boolean_t nowait; - amqp_table_t arguments; + uint16_t ticket; /**< ticket */ + amqp_bytes_t exchange; /**< exchange */ + amqp_bytes_t type; /**< type */ + amqp_boolean_t passive; /**< passive */ + amqp_boolean_t durable; /**< durable */ + amqp_boolean_t auto_delete; /**< auto-delete */ + amqp_boolean_t internal; /**< internal */ + amqp_boolean_t nowait; /**< nowait */ + amqp_table_t arguments; /**< arguments */ } amqp_exchange_declare_t; -#define AMQP_EXCHANGE_DECLARE_OK_METHOD ((amqp_method_number_t) 0x0028000B) /* 40, 11; 2621451 */ +#define AMQP_EXCHANGE_DECLARE_OK_METHOD ((amqp_method_number_t) 0x0028000B) /**< exchange.declare-ok method id @internal 40, 11; 2621451 */ +/** exchange.declare-ok method fields */ typedef struct amqp_exchange_declare_ok_t_ { - char dummy; /* Dummy field to avoid empty struct */ + char dummy; /**< Dummy field to avoid empty struct */ } amqp_exchange_declare_ok_t; -#define AMQP_EXCHANGE_DELETE_METHOD ((amqp_method_number_t) 0x00280014) /* 40, 20; 2621460 */ +#define AMQP_EXCHANGE_DELETE_METHOD ((amqp_method_number_t) 0x00280014) /**< exchange.delete method id @internal 40, 20; 2621460 */ +/** exchange.delete method fields */ typedef struct amqp_exchange_delete_t_ { - uint16_t ticket; - amqp_bytes_t exchange; - amqp_boolean_t if_unused; - amqp_boolean_t nowait; + uint16_t ticket; /**< ticket */ + amqp_bytes_t exchange; /**< exchange */ + amqp_boolean_t if_unused; /**< if-unused */ + amqp_boolean_t nowait; /**< nowait */ } amqp_exchange_delete_t; -#define AMQP_EXCHANGE_DELETE_OK_METHOD ((amqp_method_number_t) 0x00280015) /* 40, 21; 2621461 */ +#define AMQP_EXCHANGE_DELETE_OK_METHOD ((amqp_method_number_t) 0x00280015) /**< exchange.delete-ok method id @internal 40, 21; 2621461 */ +/** exchange.delete-ok method fields */ typedef struct amqp_exchange_delete_ok_t_ { - char dummy; /* Dummy field to avoid empty struct */ + char dummy; /**< Dummy field to avoid empty struct */ } amqp_exchange_delete_ok_t; -#define AMQP_EXCHANGE_BIND_METHOD ((amqp_method_number_t) 0x0028001E) /* 40, 30; 2621470 */ +#define AMQP_EXCHANGE_BIND_METHOD ((amqp_method_number_t) 0x0028001E) /**< exchange.bind method id @internal 40, 30; 2621470 */ +/** exchange.bind method fields */ typedef struct amqp_exchange_bind_t_ { - uint16_t ticket; - amqp_bytes_t destination; - amqp_bytes_t source; - amqp_bytes_t routing_key; - amqp_boolean_t nowait; - amqp_table_t arguments; + uint16_t ticket; /**< ticket */ + amqp_bytes_t destination; /**< destination */ + amqp_bytes_t source; /**< source */ + amqp_bytes_t routing_key; /**< routing-key */ + amqp_boolean_t nowait; /**< nowait */ + amqp_table_t arguments; /**< arguments */ } amqp_exchange_bind_t; -#define AMQP_EXCHANGE_BIND_OK_METHOD ((amqp_method_number_t) 0x0028001F) /* 40, 31; 2621471 */ +#define AMQP_EXCHANGE_BIND_OK_METHOD ((amqp_method_number_t) 0x0028001F) /**< exchange.bind-ok method id @internal 40, 31; 2621471 */ +/** exchange.bind-ok method fields */ typedef struct amqp_exchange_bind_ok_t_ { - char dummy; /* Dummy field to avoid empty struct */ + char dummy; /**< Dummy field to avoid empty struct */ } amqp_exchange_bind_ok_t; -#define AMQP_EXCHANGE_UNBIND_METHOD ((amqp_method_number_t) 0x00280028) /* 40, 40; 2621480 */ +#define AMQP_EXCHANGE_UNBIND_METHOD ((amqp_method_number_t) 0x00280028) /**< exchange.unbind method id @internal 40, 40; 2621480 */ +/** exchange.unbind method fields */ typedef struct amqp_exchange_unbind_t_ { - uint16_t ticket; - amqp_bytes_t destination; - amqp_bytes_t source; - amqp_bytes_t routing_key; - amqp_boolean_t nowait; - amqp_table_t arguments; + uint16_t ticket; /**< ticket */ + amqp_bytes_t destination; /**< destination */ + amqp_bytes_t source; /**< source */ + amqp_bytes_t routing_key; /**< routing-key */ + amqp_boolean_t nowait; /**< nowait */ + amqp_table_t arguments; /**< arguments */ } amqp_exchange_unbind_t; -#define AMQP_EXCHANGE_UNBIND_OK_METHOD ((amqp_method_number_t) 0x00280033) /* 40, 51; 2621491 */ +#define AMQP_EXCHANGE_UNBIND_OK_METHOD ((amqp_method_number_t) 0x00280033) /**< exchange.unbind-ok method id @internal 40, 51; 2621491 */ +/** exchange.unbind-ok method fields */ typedef struct amqp_exchange_unbind_ok_t_ { - char dummy; /* Dummy field to avoid empty struct */ + char dummy; /**< Dummy field to avoid empty struct */ } amqp_exchange_unbind_ok_t; -#define AMQP_QUEUE_DECLARE_METHOD ((amqp_method_number_t) 0x0032000A) /* 50, 10; 3276810 */ +#define AMQP_QUEUE_DECLARE_METHOD ((amqp_method_number_t) 0x0032000A) /**< queue.declare method id @internal 50, 10; 3276810 */ +/** queue.declare method fields */ typedef struct amqp_queue_declare_t_ { - uint16_t ticket; - amqp_bytes_t queue; - amqp_boolean_t passive; - amqp_boolean_t durable; - amqp_boolean_t exclusive; - amqp_boolean_t auto_delete; - amqp_boolean_t nowait; - amqp_table_t arguments; + uint16_t ticket; /**< ticket */ + amqp_bytes_t queue; /**< queue */ + amqp_boolean_t passive; /**< passive */ + amqp_boolean_t durable; /**< durable */ + amqp_boolean_t exclusive; /**< exclusive */ + amqp_boolean_t auto_delete; /**< auto-delete */ + amqp_boolean_t nowait; /**< nowait */ + amqp_table_t arguments; /**< arguments */ } amqp_queue_declare_t; -#define AMQP_QUEUE_DECLARE_OK_METHOD ((amqp_method_number_t) 0x0032000B) /* 50, 11; 3276811 */ +#define AMQP_QUEUE_DECLARE_OK_METHOD ((amqp_method_number_t) 0x0032000B) /**< queue.declare-ok method id @internal 50, 11; 3276811 */ +/** queue.declare-ok method fields */ typedef struct amqp_queue_declare_ok_t_ { - amqp_bytes_t queue; - uint32_t message_count; - uint32_t consumer_count; + amqp_bytes_t queue; /**< queue */ + uint32_t message_count; /**< message-count */ + uint32_t consumer_count; /**< consumer-count */ } amqp_queue_declare_ok_t; -#define AMQP_QUEUE_BIND_METHOD ((amqp_method_number_t) 0x00320014) /* 50, 20; 3276820 */ +#define AMQP_QUEUE_BIND_METHOD ((amqp_method_number_t) 0x00320014) /**< queue.bind method id @internal 50, 20; 3276820 */ +/** queue.bind method fields */ typedef struct amqp_queue_bind_t_ { - uint16_t ticket; - amqp_bytes_t queue; - amqp_bytes_t exchange; - amqp_bytes_t routing_key; - amqp_boolean_t nowait; - amqp_table_t arguments; + uint16_t ticket; /**< ticket */ + amqp_bytes_t queue; /**< queue */ + amqp_bytes_t exchange; /**< exchange */ + amqp_bytes_t routing_key; /**< routing-key */ + amqp_boolean_t nowait; /**< nowait */ + amqp_table_t arguments; /**< arguments */ } amqp_queue_bind_t; -#define AMQP_QUEUE_BIND_OK_METHOD ((amqp_method_number_t) 0x00320015) /* 50, 21; 3276821 */ +#define AMQP_QUEUE_BIND_OK_METHOD ((amqp_method_number_t) 0x00320015) /**< queue.bind-ok method id @internal 50, 21; 3276821 */ +/** queue.bind-ok method fields */ typedef struct amqp_queue_bind_ok_t_ { - char dummy; /* Dummy field to avoid empty struct */ + char dummy; /**< Dummy field to avoid empty struct */ } amqp_queue_bind_ok_t; -#define AMQP_QUEUE_PURGE_METHOD ((amqp_method_number_t) 0x0032001E) /* 50, 30; 3276830 */ +#define AMQP_QUEUE_PURGE_METHOD ((amqp_method_number_t) 0x0032001E) /**< queue.purge method id @internal 50, 30; 3276830 */ +/** queue.purge method fields */ typedef struct amqp_queue_purge_t_ { - uint16_t ticket; - amqp_bytes_t queue; - amqp_boolean_t nowait; + uint16_t ticket; /**< ticket */ + amqp_bytes_t queue; /**< queue */ + amqp_boolean_t nowait; /**< nowait */ } amqp_queue_purge_t; -#define AMQP_QUEUE_PURGE_OK_METHOD ((amqp_method_number_t) 0x0032001F) /* 50, 31; 3276831 */ +#define AMQP_QUEUE_PURGE_OK_METHOD ((amqp_method_number_t) 0x0032001F) /**< queue.purge-ok method id @internal 50, 31; 3276831 */ +/** queue.purge-ok method fields */ typedef struct amqp_queue_purge_ok_t_ { - uint32_t message_count; + uint32_t message_count; /**< message-count */ } amqp_queue_purge_ok_t; -#define AMQP_QUEUE_DELETE_METHOD ((amqp_method_number_t) 0x00320028) /* 50, 40; 3276840 */ +#define AMQP_QUEUE_DELETE_METHOD ((amqp_method_number_t) 0x00320028) /**< queue.delete method id @internal 50, 40; 3276840 */ +/** queue.delete method fields */ typedef struct amqp_queue_delete_t_ { - uint16_t ticket; - amqp_bytes_t queue; - amqp_boolean_t if_unused; - amqp_boolean_t if_empty; - amqp_boolean_t nowait; + uint16_t ticket; /**< ticket */ + amqp_bytes_t queue; /**< queue */ + amqp_boolean_t if_unused; /**< if-unused */ + amqp_boolean_t if_empty; /**< if-empty */ + amqp_boolean_t nowait; /**< nowait */ } amqp_queue_delete_t; -#define AMQP_QUEUE_DELETE_OK_METHOD ((amqp_method_number_t) 0x00320029) /* 50, 41; 3276841 */ +#define AMQP_QUEUE_DELETE_OK_METHOD ((amqp_method_number_t) 0x00320029) /**< queue.delete-ok method id @internal 50, 41; 3276841 */ +/** queue.delete-ok method fields */ typedef struct amqp_queue_delete_ok_t_ { - uint32_t message_count; + uint32_t message_count; /**< message-count */ } amqp_queue_delete_ok_t; -#define AMQP_QUEUE_UNBIND_METHOD ((amqp_method_number_t) 0x00320032) /* 50, 50; 3276850 */ +#define AMQP_QUEUE_UNBIND_METHOD ((amqp_method_number_t) 0x00320032) /**< queue.unbind method id @internal 50, 50; 3276850 */ +/** queue.unbind method fields */ typedef struct amqp_queue_unbind_t_ { - uint16_t ticket; - amqp_bytes_t queue; - amqp_bytes_t exchange; - amqp_bytes_t routing_key; - amqp_table_t arguments; + uint16_t ticket; /**< ticket */ + amqp_bytes_t queue; /**< queue */ + amqp_bytes_t exchange; /**< exchange */ + amqp_bytes_t routing_key; /**< routing-key */ + amqp_table_t arguments; /**< arguments */ } amqp_queue_unbind_t; -#define AMQP_QUEUE_UNBIND_OK_METHOD ((amqp_method_number_t) 0x00320033) /* 50, 51; 3276851 */ +#define AMQP_QUEUE_UNBIND_OK_METHOD ((amqp_method_number_t) 0x00320033) /**< queue.unbind-ok method id @internal 50, 51; 3276851 */ +/** queue.unbind-ok method fields */ typedef struct amqp_queue_unbind_ok_t_ { - char dummy; /* Dummy field to avoid empty struct */ + char dummy; /**< Dummy field to avoid empty struct */ } amqp_queue_unbind_ok_t; -#define AMQP_BASIC_QOS_METHOD ((amqp_method_number_t) 0x003C000A) /* 60, 10; 3932170 */ +#define AMQP_BASIC_QOS_METHOD ((amqp_method_number_t) 0x003C000A) /**< basic.qos method id @internal 60, 10; 3932170 */ +/** basic.qos method fields */ typedef struct amqp_basic_qos_t_ { - uint32_t prefetch_size; - uint16_t prefetch_count; - amqp_boolean_t global; + uint32_t prefetch_size; /**< prefetch-size */ + uint16_t prefetch_count; /**< prefetch-count */ + amqp_boolean_t global; /**< global */ } amqp_basic_qos_t; -#define AMQP_BASIC_QOS_OK_METHOD ((amqp_method_number_t) 0x003C000B) /* 60, 11; 3932171 */ +#define AMQP_BASIC_QOS_OK_METHOD ((amqp_method_number_t) 0x003C000B) /**< basic.qos-ok method id @internal 60, 11; 3932171 */ +/** basic.qos-ok method fields */ typedef struct amqp_basic_qos_ok_t_ { - char dummy; /* Dummy field to avoid empty struct */ + char dummy; /**< Dummy field to avoid empty struct */ } amqp_basic_qos_ok_t; -#define AMQP_BASIC_CONSUME_METHOD ((amqp_method_number_t) 0x003C0014) /* 60, 20; 3932180 */ +#define AMQP_BASIC_CONSUME_METHOD ((amqp_method_number_t) 0x003C0014) /**< basic.consume method id @internal 60, 20; 3932180 */ +/** basic.consume method fields */ typedef struct amqp_basic_consume_t_ { - uint16_t ticket; - amqp_bytes_t queue; - amqp_bytes_t consumer_tag; - amqp_boolean_t no_local; - amqp_boolean_t no_ack; - amqp_boolean_t exclusive; - amqp_boolean_t nowait; - amqp_table_t arguments; + uint16_t ticket; /**< ticket */ + amqp_bytes_t queue; /**< queue */ + amqp_bytes_t consumer_tag; /**< consumer-tag */ + amqp_boolean_t no_local; /**< no-local */ + amqp_boolean_t no_ack; /**< no-ack */ + amqp_boolean_t exclusive; /**< exclusive */ + amqp_boolean_t nowait; /**< nowait */ + amqp_table_t arguments; /**< arguments */ } amqp_basic_consume_t; -#define AMQP_BASIC_CONSUME_OK_METHOD ((amqp_method_number_t) 0x003C0015) /* 60, 21; 3932181 */ +#define AMQP_BASIC_CONSUME_OK_METHOD ((amqp_method_number_t) 0x003C0015) /**< basic.consume-ok method id @internal 60, 21; 3932181 */ +/** basic.consume-ok method fields */ typedef struct amqp_basic_consume_ok_t_ { - amqp_bytes_t consumer_tag; + amqp_bytes_t consumer_tag; /**< consumer-tag */ } amqp_basic_consume_ok_t; -#define AMQP_BASIC_CANCEL_METHOD ((amqp_method_number_t) 0x003C001E) /* 60, 30; 3932190 */ +#define AMQP_BASIC_CANCEL_METHOD ((amqp_method_number_t) 0x003C001E) /**< basic.cancel method id @internal 60, 30; 3932190 */ +/** basic.cancel method fields */ typedef struct amqp_basic_cancel_t_ { - amqp_bytes_t consumer_tag; - amqp_boolean_t nowait; + amqp_bytes_t consumer_tag; /**< consumer-tag */ + amqp_boolean_t nowait; /**< nowait */ } amqp_basic_cancel_t; -#define AMQP_BASIC_CANCEL_OK_METHOD ((amqp_method_number_t) 0x003C001F) /* 60, 31; 3932191 */ +#define AMQP_BASIC_CANCEL_OK_METHOD ((amqp_method_number_t) 0x003C001F) /**< basic.cancel-ok method id @internal 60, 31; 3932191 */ +/** basic.cancel-ok method fields */ typedef struct amqp_basic_cancel_ok_t_ { - amqp_bytes_t consumer_tag; + amqp_bytes_t consumer_tag; /**< consumer-tag */ } amqp_basic_cancel_ok_t; -#define AMQP_BASIC_PUBLISH_METHOD ((amqp_method_number_t) 0x003C0028) /* 60, 40; 3932200 */ +#define AMQP_BASIC_PUBLISH_METHOD ((amqp_method_number_t) 0x003C0028) /**< basic.publish method id @internal 60, 40; 3932200 */ +/** basic.publish method fields */ typedef struct amqp_basic_publish_t_ { - uint16_t ticket; - amqp_bytes_t exchange; - amqp_bytes_t routing_key; - amqp_boolean_t mandatory; - amqp_boolean_t immediate; + uint16_t ticket; /**< ticket */ + amqp_bytes_t exchange; /**< exchange */ + amqp_bytes_t routing_key; /**< routing-key */ + amqp_boolean_t mandatory; /**< mandatory */ + amqp_boolean_t immediate; /**< immediate */ } amqp_basic_publish_t; -#define AMQP_BASIC_RETURN_METHOD ((amqp_method_number_t) 0x003C0032) /* 60, 50; 3932210 */ +#define AMQP_BASIC_RETURN_METHOD ((amqp_method_number_t) 0x003C0032) /**< basic.return method id @internal 60, 50; 3932210 */ +/** basic.return method fields */ typedef struct amqp_basic_return_t_ { - uint16_t reply_code; - amqp_bytes_t reply_text; - amqp_bytes_t exchange; - amqp_bytes_t routing_key; + uint16_t reply_code; /**< reply-code */ + amqp_bytes_t reply_text; /**< reply-text */ + amqp_bytes_t exchange; /**< exchange */ + amqp_bytes_t routing_key; /**< routing-key */ } amqp_basic_return_t; -#define AMQP_BASIC_DELIVER_METHOD ((amqp_method_number_t) 0x003C003C) /* 60, 60; 3932220 */ +#define AMQP_BASIC_DELIVER_METHOD ((amqp_method_number_t) 0x003C003C) /**< basic.deliver method id @internal 60, 60; 3932220 */ +/** basic.deliver method fields */ typedef struct amqp_basic_deliver_t_ { - amqp_bytes_t consumer_tag; - uint64_t delivery_tag; - amqp_boolean_t redelivered; - amqp_bytes_t exchange; - amqp_bytes_t routing_key; + amqp_bytes_t consumer_tag; /**< consumer-tag */ + uint64_t delivery_tag; /**< delivery-tag */ + amqp_boolean_t redelivered; /**< redelivered */ + amqp_bytes_t exchange; /**< exchange */ + amqp_bytes_t routing_key; /**< routing-key */ } amqp_basic_deliver_t; -#define AMQP_BASIC_GET_METHOD ((amqp_method_number_t) 0x003C0046) /* 60, 70; 3932230 */ +#define AMQP_BASIC_GET_METHOD ((amqp_method_number_t) 0x003C0046) /**< basic.get method id @internal 60, 70; 3932230 */ +/** basic.get method fields */ typedef struct amqp_basic_get_t_ { - uint16_t ticket; - amqp_bytes_t queue; - amqp_boolean_t no_ack; + uint16_t ticket; /**< ticket */ + amqp_bytes_t queue; /**< queue */ + amqp_boolean_t no_ack; /**< no-ack */ } amqp_basic_get_t; -#define AMQP_BASIC_GET_OK_METHOD ((amqp_method_number_t) 0x003C0047) /* 60, 71; 3932231 */ +#define AMQP_BASIC_GET_OK_METHOD ((amqp_method_number_t) 0x003C0047) /**< basic.get-ok method id @internal 60, 71; 3932231 */ +/** basic.get-ok method fields */ typedef struct amqp_basic_get_ok_t_ { - uint64_t delivery_tag; - amqp_boolean_t redelivered; - amqp_bytes_t exchange; - amqp_bytes_t routing_key; - uint32_t message_count; + uint64_t delivery_tag; /**< delivery-tag */ + amqp_boolean_t redelivered; /**< redelivered */ + amqp_bytes_t exchange; /**< exchange */ + amqp_bytes_t routing_key; /**< routing-key */ + uint32_t message_count; /**< message-count */ } amqp_basic_get_ok_t; -#define AMQP_BASIC_GET_EMPTY_METHOD ((amqp_method_number_t) 0x003C0048) /* 60, 72; 3932232 */ +#define AMQP_BASIC_GET_EMPTY_METHOD ((amqp_method_number_t) 0x003C0048) /**< basic.get-empty method id @internal 60, 72; 3932232 */ +/** basic.get-empty method fields */ typedef struct amqp_basic_get_empty_t_ { - amqp_bytes_t cluster_id; + amqp_bytes_t cluster_id; /**< cluster-id */ } amqp_basic_get_empty_t; -#define AMQP_BASIC_ACK_METHOD ((amqp_method_number_t) 0x003C0050) /* 60, 80; 3932240 */ +#define AMQP_BASIC_ACK_METHOD ((amqp_method_number_t) 0x003C0050) /**< basic.ack method id @internal 60, 80; 3932240 */ +/** basic.ack method fields */ typedef struct amqp_basic_ack_t_ { - uint64_t delivery_tag; - amqp_boolean_t multiple; + uint64_t delivery_tag; /**< delivery-tag */ + amqp_boolean_t multiple; /**< multiple */ } amqp_basic_ack_t; -#define AMQP_BASIC_REJECT_METHOD ((amqp_method_number_t) 0x003C005A) /* 60, 90; 3932250 */ +#define AMQP_BASIC_REJECT_METHOD ((amqp_method_number_t) 0x003C005A) /**< basic.reject method id @internal 60, 90; 3932250 */ +/** basic.reject method fields */ typedef struct amqp_basic_reject_t_ { - uint64_t delivery_tag; - amqp_boolean_t requeue; + uint64_t delivery_tag; /**< delivery-tag */ + amqp_boolean_t requeue; /**< requeue */ } amqp_basic_reject_t; -#define AMQP_BASIC_RECOVER_ASYNC_METHOD ((amqp_method_number_t) 0x003C0064) /* 60, 100; 3932260 */ +#define AMQP_BASIC_RECOVER_ASYNC_METHOD ((amqp_method_number_t) 0x003C0064) /**< basic.recover-async method id @internal 60, 100; 3932260 */ +/** basic.recover-async method fields */ typedef struct amqp_basic_recover_async_t_ { - amqp_boolean_t requeue; + amqp_boolean_t requeue; /**< requeue */ } amqp_basic_recover_async_t; -#define AMQP_BASIC_RECOVER_METHOD ((amqp_method_number_t) 0x003C006E) /* 60, 110; 3932270 */ +#define AMQP_BASIC_RECOVER_METHOD ((amqp_method_number_t) 0x003C006E) /**< basic.recover method id @internal 60, 110; 3932270 */ +/** basic.recover method fields */ typedef struct amqp_basic_recover_t_ { - amqp_boolean_t requeue; + amqp_boolean_t requeue; /**< requeue */ } amqp_basic_recover_t; -#define AMQP_BASIC_RECOVER_OK_METHOD ((amqp_method_number_t) 0x003C006F) /* 60, 111; 3932271 */ +#define AMQP_BASIC_RECOVER_OK_METHOD ((amqp_method_number_t) 0x003C006F) /**< basic.recover-ok method id @internal 60, 111; 3932271 */ +/** basic.recover-ok method fields */ typedef struct amqp_basic_recover_ok_t_ { - char dummy; /* Dummy field to avoid empty struct */ + char dummy; /**< Dummy field to avoid empty struct */ } amqp_basic_recover_ok_t; -#define AMQP_BASIC_NACK_METHOD ((amqp_method_number_t) 0x003C0078) /* 60, 120; 3932280 */ +#define AMQP_BASIC_NACK_METHOD ((amqp_method_number_t) 0x003C0078) /**< basic.nack method id @internal 60, 120; 3932280 */ +/** basic.nack method fields */ typedef struct amqp_basic_nack_t_ { - uint64_t delivery_tag; - amqp_boolean_t multiple; - amqp_boolean_t requeue; + uint64_t delivery_tag; /**< delivery-tag */ + amqp_boolean_t multiple; /**< multiple */ + amqp_boolean_t requeue; /**< requeue */ } amqp_basic_nack_t; -#define AMQP_TX_SELECT_METHOD ((amqp_method_number_t) 0x005A000A) /* 90, 10; 5898250 */ +#define AMQP_TX_SELECT_METHOD ((amqp_method_number_t) 0x005A000A) /**< tx.select method id @internal 90, 10; 5898250 */ +/** tx.select method fields */ typedef struct amqp_tx_select_t_ { - char dummy; /* Dummy field to avoid empty struct */ + char dummy; /**< Dummy field to avoid empty struct */ } amqp_tx_select_t; -#define AMQP_TX_SELECT_OK_METHOD ((amqp_method_number_t) 0x005A000B) /* 90, 11; 5898251 */ +#define AMQP_TX_SELECT_OK_METHOD ((amqp_method_number_t) 0x005A000B) /**< tx.select-ok method id @internal 90, 11; 5898251 */ +/** tx.select-ok method fields */ typedef struct amqp_tx_select_ok_t_ { - char dummy; /* Dummy field to avoid empty struct */ + char dummy; /**< Dummy field to avoid empty struct */ } amqp_tx_select_ok_t; -#define AMQP_TX_COMMIT_METHOD ((amqp_method_number_t) 0x005A0014) /* 90, 20; 5898260 */ +#define AMQP_TX_COMMIT_METHOD ((amqp_method_number_t) 0x005A0014) /**< tx.commit method id @internal 90, 20; 5898260 */ +/** tx.commit method fields */ typedef struct amqp_tx_commit_t_ { - char dummy; /* Dummy field to avoid empty struct */ + char dummy; /**< Dummy field to avoid empty struct */ } amqp_tx_commit_t; -#define AMQP_TX_COMMIT_OK_METHOD ((amqp_method_number_t) 0x005A0015) /* 90, 21; 5898261 */ +#define AMQP_TX_COMMIT_OK_METHOD ((amqp_method_number_t) 0x005A0015) /**< tx.commit-ok method id @internal 90, 21; 5898261 */ +/** tx.commit-ok method fields */ typedef struct amqp_tx_commit_ok_t_ { - char dummy; /* Dummy field to avoid empty struct */ + char dummy; /**< Dummy field to avoid empty struct */ } amqp_tx_commit_ok_t; -#define AMQP_TX_ROLLBACK_METHOD ((amqp_method_number_t) 0x005A001E) /* 90, 30; 5898270 */ +#define AMQP_TX_ROLLBACK_METHOD ((amqp_method_number_t) 0x005A001E) /**< tx.rollback method id @internal 90, 30; 5898270 */ +/** tx.rollback method fields */ typedef struct amqp_tx_rollback_t_ { - char dummy; /* Dummy field to avoid empty struct */ + char dummy; /**< Dummy field to avoid empty struct */ } amqp_tx_rollback_t; -#define AMQP_TX_ROLLBACK_OK_METHOD ((amqp_method_number_t) 0x005A001F) /* 90, 31; 5898271 */ +#define AMQP_TX_ROLLBACK_OK_METHOD ((amqp_method_number_t) 0x005A001F) /**< tx.rollback-ok method id @internal 90, 31; 5898271 */ +/** tx.rollback-ok method fields */ typedef struct amqp_tx_rollback_ok_t_ { - char dummy; /* Dummy field to avoid empty struct */ + char dummy; /**< Dummy field to avoid empty struct */ } amqp_tx_rollback_ok_t; -#define AMQP_CONFIRM_SELECT_METHOD ((amqp_method_number_t) 0x0055000A) /* 85, 10; 5570570 */ +#define AMQP_CONFIRM_SELECT_METHOD ((amqp_method_number_t) 0x0055000A) /**< confirm.select method id @internal 85, 10; 5570570 */ +/** confirm.select method fields */ typedef struct amqp_confirm_select_t_ { - amqp_boolean_t nowait; + amqp_boolean_t nowait; /**< nowait */ } amqp_confirm_select_t; -#define AMQP_CONFIRM_SELECT_OK_METHOD ((amqp_method_number_t) 0x0055000B) /* 85, 11; 5570571 */ +#define AMQP_CONFIRM_SELECT_OK_METHOD ((amqp_method_number_t) 0x0055000B) /**< confirm.select-ok method id @internal 85, 11; 5570571 */ +/** confirm.select-ok method fields */ typedef struct amqp_confirm_select_ok_t_ { - char dummy; /* Dummy field to avoid empty struct */ + char dummy; /**< Dummy field to avoid empty struct */ } amqp_confirm_select_ok_t; /* Class property records. */ -#define AMQP_CONNECTION_CLASS (0x000A) /* 10 */ +#define AMQP_CONNECTION_CLASS (0x000A) /**< connection class id @internal 10 */ +/** connection class properties */ typedef struct amqp_connection_properties_t_ { - amqp_flags_t _flags; - char dummy; /* Dummy field to avoid empty struct */ + amqp_flags_t _flags; /**< bit-mask of set fields */ + char dummy; /**< Dummy field to avoid empty struct */ } amqp_connection_properties_t; -#define AMQP_CHANNEL_CLASS (0x0014) /* 20 */ +#define AMQP_CHANNEL_CLASS (0x0014) /**< channel class id @internal 20 */ +/** channel class properties */ typedef struct amqp_channel_properties_t_ { - amqp_flags_t _flags; - char dummy; /* Dummy field to avoid empty struct */ + amqp_flags_t _flags; /**< bit-mask of set fields */ + char dummy; /**< Dummy field to avoid empty struct */ } amqp_channel_properties_t; -#define AMQP_ACCESS_CLASS (0x001E) /* 30 */ +#define AMQP_ACCESS_CLASS (0x001E) /**< access class id @internal 30 */ +/** access class properties */ typedef struct amqp_access_properties_t_ { - amqp_flags_t _flags; - char dummy; /* Dummy field to avoid empty struct */ + amqp_flags_t _flags; /**< bit-mask of set fields */ + char dummy; /**< Dummy field to avoid empty struct */ } amqp_access_properties_t; -#define AMQP_EXCHANGE_CLASS (0x0028) /* 40 */ +#define AMQP_EXCHANGE_CLASS (0x0028) /**< exchange class id @internal 40 */ +/** exchange class properties */ typedef struct amqp_exchange_properties_t_ { - amqp_flags_t _flags; - char dummy; /* Dummy field to avoid empty struct */ + amqp_flags_t _flags; /**< bit-mask of set fields */ + char dummy; /**< Dummy field to avoid empty struct */ } amqp_exchange_properties_t; -#define AMQP_QUEUE_CLASS (0x0032) /* 50 */ +#define AMQP_QUEUE_CLASS (0x0032) /**< queue class id @internal 50 */ +/** queue class properties */ typedef struct amqp_queue_properties_t_ { - amqp_flags_t _flags; - char dummy; /* Dummy field to avoid empty struct */ + amqp_flags_t _flags; /**< bit-mask of set fields */ + char dummy; /**< Dummy field to avoid empty struct */ } amqp_queue_properties_t; -#define AMQP_BASIC_CLASS (0x003C) /* 60 */ -#define AMQP_BASIC_CONTENT_TYPE_FLAG (1 << 15) -#define AMQP_BASIC_CONTENT_ENCODING_FLAG (1 << 14) -#define AMQP_BASIC_HEADERS_FLAG (1 << 13) -#define AMQP_BASIC_DELIVERY_MODE_FLAG (1 << 12) -#define AMQP_BASIC_PRIORITY_FLAG (1 << 11) -#define AMQP_BASIC_CORRELATION_ID_FLAG (1 << 10) -#define AMQP_BASIC_REPLY_TO_FLAG (1 << 9) -#define AMQP_BASIC_EXPIRATION_FLAG (1 << 8) -#define AMQP_BASIC_MESSAGE_ID_FLAG (1 << 7) -#define AMQP_BASIC_TIMESTAMP_FLAG (1 << 6) -#define AMQP_BASIC_TYPE_FLAG (1 << 5) -#define AMQP_BASIC_USER_ID_FLAG (1 << 4) -#define AMQP_BASIC_APP_ID_FLAG (1 << 3) -#define AMQP_BASIC_CLUSTER_ID_FLAG (1 << 2) +#define AMQP_BASIC_CLASS (0x003C) /**< basic class id @internal 60 */ +#define AMQP_BASIC_CONTENT_TYPE_FLAG (1 << 15) /**< basic.content-type property flag */ +#define AMQP_BASIC_CONTENT_ENCODING_FLAG (1 << 14) /**< basic.content-encoding property flag */ +#define AMQP_BASIC_HEADERS_FLAG (1 << 13) /**< basic.headers property flag */ +#define AMQP_BASIC_DELIVERY_MODE_FLAG (1 << 12) /**< basic.delivery-mode property flag */ +#define AMQP_BASIC_PRIORITY_FLAG (1 << 11) /**< basic.priority property flag */ +#define AMQP_BASIC_CORRELATION_ID_FLAG (1 << 10) /**< basic.correlation-id property flag */ +#define AMQP_BASIC_REPLY_TO_FLAG (1 << 9) /**< basic.reply-to property flag */ +#define AMQP_BASIC_EXPIRATION_FLAG (1 << 8) /**< basic.expiration property flag */ +#define AMQP_BASIC_MESSAGE_ID_FLAG (1 << 7) /**< basic.message-id property flag */ +#define AMQP_BASIC_TIMESTAMP_FLAG (1 << 6) /**< basic.timestamp property flag */ +#define AMQP_BASIC_TYPE_FLAG (1 << 5) /**< basic.type property flag */ +#define AMQP_BASIC_USER_ID_FLAG (1 << 4) /**< basic.user-id property flag */ +#define AMQP_BASIC_APP_ID_FLAG (1 << 3) /**< basic.app-id property flag */ +#define AMQP_BASIC_CLUSTER_ID_FLAG (1 << 2) /**< basic.cluster-id property flag */ +/** basic class properties */ typedef struct amqp_basic_properties_t_ { - amqp_flags_t _flags; - amqp_bytes_t content_type; - amqp_bytes_t content_encoding; - amqp_table_t headers; - uint8_t delivery_mode; - uint8_t priority; - amqp_bytes_t correlation_id; - amqp_bytes_t reply_to; - amqp_bytes_t expiration; - amqp_bytes_t message_id; - uint64_t timestamp; - amqp_bytes_t type; - amqp_bytes_t user_id; - amqp_bytes_t app_id; - amqp_bytes_t cluster_id; + amqp_flags_t _flags; /**< bit-mask of set fields */ + amqp_bytes_t content_type; /**< content-type */ + amqp_bytes_t content_encoding; /**< content-encoding */ + amqp_table_t headers; /**< headers */ + uint8_t delivery_mode; /**< delivery-mode */ + uint8_t priority; /**< priority */ + amqp_bytes_t correlation_id; /**< correlation-id */ + amqp_bytes_t reply_to; /**< reply-to */ + amqp_bytes_t expiration; /**< expiration */ + amqp_bytes_t message_id; /**< message-id */ + uint64_t timestamp; /**< timestamp */ + amqp_bytes_t type; /**< type */ + amqp_bytes_t user_id; /**< user-id */ + amqp_bytes_t app_id; /**< app-id */ + amqp_bytes_t cluster_id; /**< cluster-id */ } amqp_basic_properties_t; -#define AMQP_TX_CLASS (0x005A) /* 90 */ +#define AMQP_TX_CLASS (0x005A) /**< tx class id @internal 90 */ +/** tx class properties */ typedef struct amqp_tx_properties_t_ { - amqp_flags_t _flags; - char dummy; /* Dummy field to avoid empty struct */ + amqp_flags_t _flags; /**< bit-mask of set fields */ + char dummy; /**< Dummy field to avoid empty struct */ } amqp_tx_properties_t; -#define AMQP_CONFIRM_CLASS (0x0055) /* 85 */ +#define AMQP_CONFIRM_CLASS (0x0055) /**< confirm class id @internal 85 */ +/** confirm class properties */ typedef struct amqp_confirm_properties_t_ { - amqp_flags_t _flags; - char dummy; /* Dummy field to avoid empty struct */ + amqp_flags_t _flags; /**< bit-mask of set fields */ + char dummy; /**< Dummy field to avoid empty struct */ } amqp_confirm_properties_t; /* API functions for methods */ -AMQP_PUBLIC_FUNCTION amqp_channel_open_ok_t * AMQP_CALL amqp_channel_open(amqp_connection_state_t state, amqp_channel_t channel); -AMQP_PUBLIC_FUNCTION amqp_channel_flow_ok_t * AMQP_CALL amqp_channel_flow(amqp_connection_state_t state, amqp_channel_t channel, amqp_boolean_t active); -AMQP_PUBLIC_FUNCTION amqp_exchange_declare_ok_t * AMQP_CALL amqp_exchange_declare(amqp_connection_state_t state, amqp_channel_t channel, amqp_bytes_t exchange, amqp_bytes_t type, amqp_boolean_t passive, amqp_boolean_t durable, amqp_table_t arguments); -AMQP_PUBLIC_FUNCTION amqp_exchange_delete_ok_t * AMQP_CALL amqp_exchange_delete(amqp_connection_state_t state, amqp_channel_t channel, amqp_bytes_t exchange, amqp_boolean_t if_unused); -AMQP_PUBLIC_FUNCTION amqp_exchange_bind_ok_t * AMQP_CALL amqp_exchange_bind(amqp_connection_state_t state, amqp_channel_t channel, amqp_bytes_t destination, amqp_bytes_t source, amqp_bytes_t routing_key, amqp_table_t arguments); -AMQP_PUBLIC_FUNCTION amqp_exchange_unbind_ok_t * AMQP_CALL amqp_exchange_unbind(amqp_connection_state_t state, amqp_channel_t channel, amqp_bytes_t destination, amqp_bytes_t source, amqp_bytes_t routing_key, amqp_table_t arguments); -AMQP_PUBLIC_FUNCTION amqp_queue_declare_ok_t * AMQP_CALL amqp_queue_declare(amqp_connection_state_t state, amqp_channel_t channel, amqp_bytes_t queue, amqp_boolean_t passive, amqp_boolean_t durable, amqp_boolean_t exclusive, amqp_boolean_t auto_delete, amqp_table_t arguments); -AMQP_PUBLIC_FUNCTION amqp_queue_bind_ok_t * AMQP_CALL amqp_queue_bind(amqp_connection_state_t state, amqp_channel_t channel, amqp_bytes_t queue, amqp_bytes_t exchange, amqp_bytes_t routing_key, amqp_table_t arguments); -AMQP_PUBLIC_FUNCTION amqp_queue_purge_ok_t * AMQP_CALL amqp_queue_purge(amqp_connection_state_t state, amqp_channel_t channel, amqp_bytes_t queue); -AMQP_PUBLIC_FUNCTION amqp_queue_delete_ok_t * AMQP_CALL amqp_queue_delete(amqp_connection_state_t state, amqp_channel_t channel, amqp_bytes_t queue, amqp_boolean_t if_unused, amqp_boolean_t if_empty); -AMQP_PUBLIC_FUNCTION amqp_queue_unbind_ok_t * AMQP_CALL amqp_queue_unbind(amqp_connection_state_t state, amqp_channel_t channel, amqp_bytes_t queue, amqp_bytes_t exchange, amqp_bytes_t routing_key, amqp_table_t arguments); -AMQP_PUBLIC_FUNCTION amqp_basic_qos_ok_t * AMQP_CALL amqp_basic_qos(amqp_connection_state_t state, amqp_channel_t channel, uint32_t prefetch_size, uint16_t prefetch_count, amqp_boolean_t global); -AMQP_PUBLIC_FUNCTION amqp_basic_consume_ok_t * AMQP_CALL amqp_basic_consume(amqp_connection_state_t state, amqp_channel_t channel, amqp_bytes_t queue, amqp_bytes_t consumer_tag, amqp_boolean_t no_local, amqp_boolean_t no_ack, amqp_boolean_t exclusive, amqp_table_t arguments); -AMQP_PUBLIC_FUNCTION amqp_basic_cancel_ok_t * AMQP_CALL amqp_basic_cancel(amqp_connection_state_t state, amqp_channel_t channel, amqp_bytes_t consumer_tag); -AMQP_PUBLIC_FUNCTION amqp_basic_recover_ok_t * AMQP_CALL amqp_basic_recover(amqp_connection_state_t state, amqp_channel_t channel, amqp_boolean_t requeue); -AMQP_PUBLIC_FUNCTION amqp_tx_select_ok_t * AMQP_CALL amqp_tx_select(amqp_connection_state_t state, amqp_channel_t channel); -AMQP_PUBLIC_FUNCTION amqp_tx_commit_ok_t * AMQP_CALL amqp_tx_commit(amqp_connection_state_t state, amqp_channel_t channel); -AMQP_PUBLIC_FUNCTION amqp_tx_rollback_ok_t * AMQP_CALL amqp_tx_rollback(amqp_connection_state_t state, amqp_channel_t channel); -AMQP_PUBLIC_FUNCTION amqp_confirm_select_ok_t * AMQP_CALL amqp_confirm_select(amqp_connection_state_t state, amqp_channel_t channel); +/** + * amqp_channel_open + * + * @param [in] state connection state + * @param [in] channel the channel to do the RPC on + * @returns amqp_channel_open_ok_t + */ +AMQP_PUBLIC_FUNCTION +amqp_channel_open_ok_t * +AMQP_CALL amqp_channel_open(amqp_connection_state_t state, amqp_channel_t channel); +/** + * amqp_channel_flow + * + * @param [in] state connection state + * @param [in] channel the channel to do the RPC on + * @param [in] active active + * @returns amqp_channel_flow_ok_t + */ +AMQP_PUBLIC_FUNCTION +amqp_channel_flow_ok_t * +AMQP_CALL amqp_channel_flow(amqp_connection_state_t state, amqp_channel_t channel, amqp_boolean_t active); +/** + * amqp_exchange_declare + * + * @param [in] state connection state + * @param [in] channel the channel to do the RPC on + * @param [in] exchange exchange + * @param [in] type type + * @param [in] passive passive + * @param [in] durable durable + * @param [in] arguments arguments + * @returns amqp_exchange_declare_ok_t + */ +AMQP_PUBLIC_FUNCTION +amqp_exchange_declare_ok_t * +AMQP_CALL amqp_exchange_declare(amqp_connection_state_t state, amqp_channel_t channel, amqp_bytes_t exchange, amqp_bytes_t type, amqp_boolean_t passive, amqp_boolean_t durable, amqp_table_t arguments); +/** + * amqp_exchange_delete + * + * @param [in] state connection state + * @param [in] channel the channel to do the RPC on + * @param [in] exchange exchange + * @param [in] if_unused if_unused + * @returns amqp_exchange_delete_ok_t + */ +AMQP_PUBLIC_FUNCTION +amqp_exchange_delete_ok_t * +AMQP_CALL amqp_exchange_delete(amqp_connection_state_t state, amqp_channel_t channel, amqp_bytes_t exchange, amqp_boolean_t if_unused); +/** + * amqp_exchange_bind + * + * @param [in] state connection state + * @param [in] channel the channel to do the RPC on + * @param [in] destination destination + * @param [in] source source + * @param [in] routing_key routing_key + * @param [in] arguments arguments + * @returns amqp_exchange_bind_ok_t + */ +AMQP_PUBLIC_FUNCTION +amqp_exchange_bind_ok_t * +AMQP_CALL amqp_exchange_bind(amqp_connection_state_t state, amqp_channel_t channel, amqp_bytes_t destination, amqp_bytes_t source, amqp_bytes_t routing_key, amqp_table_t arguments); +/** + * amqp_exchange_unbind + * + * @param [in] state connection state + * @param [in] channel the channel to do the RPC on + * @param [in] destination destination + * @param [in] source source + * @param [in] routing_key routing_key + * @param [in] arguments arguments + * @returns amqp_exchange_unbind_ok_t + */ +AMQP_PUBLIC_FUNCTION +amqp_exchange_unbind_ok_t * +AMQP_CALL amqp_exchange_unbind(amqp_connection_state_t state, amqp_channel_t channel, amqp_bytes_t destination, amqp_bytes_t source, amqp_bytes_t routing_key, amqp_table_t arguments); +/** + * amqp_queue_declare + * + * @param [in] state connection state + * @param [in] channel the channel to do the RPC on + * @param [in] queue queue + * @param [in] passive passive + * @param [in] durable durable + * @param [in] exclusive exclusive + * @param [in] auto_delete auto_delete + * @param [in] arguments arguments + * @returns amqp_queue_declare_ok_t + */ +AMQP_PUBLIC_FUNCTION +amqp_queue_declare_ok_t * +AMQP_CALL amqp_queue_declare(amqp_connection_state_t state, amqp_channel_t channel, amqp_bytes_t queue, amqp_boolean_t passive, amqp_boolean_t durable, amqp_boolean_t exclusive, amqp_boolean_t auto_delete, amqp_table_t arguments); +/** + * amqp_queue_bind + * + * @param [in] state connection state + * @param [in] channel the channel to do the RPC on + * @param [in] queue queue + * @param [in] exchange exchange + * @param [in] routing_key routing_key + * @param [in] arguments arguments + * @returns amqp_queue_bind_ok_t + */ +AMQP_PUBLIC_FUNCTION +amqp_queue_bind_ok_t * +AMQP_CALL amqp_queue_bind(amqp_connection_state_t state, amqp_channel_t channel, amqp_bytes_t queue, amqp_bytes_t exchange, amqp_bytes_t routing_key, amqp_table_t arguments); +/** + * amqp_queue_purge + * + * @param [in] state connection state + * @param [in] channel the channel to do the RPC on + * @param [in] queue queue + * @returns amqp_queue_purge_ok_t + */ +AMQP_PUBLIC_FUNCTION +amqp_queue_purge_ok_t * +AMQP_CALL amqp_queue_purge(amqp_connection_state_t state, amqp_channel_t channel, amqp_bytes_t queue); +/** + * amqp_queue_delete + * + * @param [in] state connection state + * @param [in] channel the channel to do the RPC on + * @param [in] queue queue + * @param [in] if_unused if_unused + * @param [in] if_empty if_empty + * @returns amqp_queue_delete_ok_t + */ +AMQP_PUBLIC_FUNCTION +amqp_queue_delete_ok_t * +AMQP_CALL amqp_queue_delete(amqp_connection_state_t state, amqp_channel_t channel, amqp_bytes_t queue, amqp_boolean_t if_unused, amqp_boolean_t if_empty); +/** + * amqp_queue_unbind + * + * @param [in] state connection state + * @param [in] channel the channel to do the RPC on + * @param [in] queue queue + * @param [in] exchange exchange + * @param [in] routing_key routing_key + * @param [in] arguments arguments + * @returns amqp_queue_unbind_ok_t + */ +AMQP_PUBLIC_FUNCTION +amqp_queue_unbind_ok_t * +AMQP_CALL amqp_queue_unbind(amqp_connection_state_t state, amqp_channel_t channel, amqp_bytes_t queue, amqp_bytes_t exchange, amqp_bytes_t routing_key, amqp_table_t arguments); +/** + * amqp_basic_qos + * + * @param [in] state connection state + * @param [in] channel the channel to do the RPC on + * @param [in] prefetch_size prefetch_size + * @param [in] prefetch_count prefetch_count + * @param [in] global global + * @returns amqp_basic_qos_ok_t + */ +AMQP_PUBLIC_FUNCTION +amqp_basic_qos_ok_t * +AMQP_CALL amqp_basic_qos(amqp_connection_state_t state, amqp_channel_t channel, uint32_t prefetch_size, uint16_t prefetch_count, amqp_boolean_t global); +/** + * amqp_basic_consume + * + * @param [in] state connection state + * @param [in] channel the channel to do the RPC on + * @param [in] queue queue + * @param [in] consumer_tag consumer_tag + * @param [in] no_local no_local + * @param [in] no_ack no_ack + * @param [in] exclusive exclusive + * @param [in] arguments arguments + * @returns amqp_basic_consume_ok_t + */ +AMQP_PUBLIC_FUNCTION +amqp_basic_consume_ok_t * +AMQP_CALL amqp_basic_consume(amqp_connection_state_t state, amqp_channel_t channel, amqp_bytes_t queue, amqp_bytes_t consumer_tag, amqp_boolean_t no_local, amqp_boolean_t no_ack, amqp_boolean_t exclusive, amqp_table_t arguments); +/** + * amqp_basic_cancel + * + * @param [in] state connection state + * @param [in] channel the channel to do the RPC on + * @param [in] consumer_tag consumer_tag + * @returns amqp_basic_cancel_ok_t + */ +AMQP_PUBLIC_FUNCTION +amqp_basic_cancel_ok_t * +AMQP_CALL amqp_basic_cancel(amqp_connection_state_t state, amqp_channel_t channel, amqp_bytes_t consumer_tag); +/** + * amqp_basic_recover + * + * @param [in] state connection state + * @param [in] channel the channel to do the RPC on + * @param [in] requeue requeue + * @returns amqp_basic_recover_ok_t + */ +AMQP_PUBLIC_FUNCTION +amqp_basic_recover_ok_t * +AMQP_CALL amqp_basic_recover(amqp_connection_state_t state, amqp_channel_t channel, amqp_boolean_t requeue); +/** + * amqp_tx_select + * + * @param [in] state connection state + * @param [in] channel the channel to do the RPC on + * @returns amqp_tx_select_ok_t + */ +AMQP_PUBLIC_FUNCTION +amqp_tx_select_ok_t * +AMQP_CALL amqp_tx_select(amqp_connection_state_t state, amqp_channel_t channel); +/** + * amqp_tx_commit + * + * @param [in] state connection state + * @param [in] channel the channel to do the RPC on + * @returns amqp_tx_commit_ok_t + */ +AMQP_PUBLIC_FUNCTION +amqp_tx_commit_ok_t * +AMQP_CALL amqp_tx_commit(amqp_connection_state_t state, amqp_channel_t channel); +/** + * amqp_tx_rollback + * + * @param [in] state connection state + * @param [in] channel the channel to do the RPC on + * @returns amqp_tx_rollback_ok_t + */ +AMQP_PUBLIC_FUNCTION +amqp_tx_rollback_ok_t * +AMQP_CALL amqp_tx_rollback(amqp_connection_state_t state, amqp_channel_t channel); +/** + * amqp_confirm_select + * + * @param [in] state connection state + * @param [in] channel the channel to do the RPC on + * @returns amqp_confirm_select_ok_t + */ +AMQP_PUBLIC_FUNCTION +amqp_confirm_select_ok_t * +AMQP_CALL amqp_confirm_select(amqp_connection_state_t state, amqp_channel_t channel); AMQP_END_DECLS -- cgit v1.2.1 From 9626dd5cd5f78894f1416a1afd2d624ddd4904ae Mon Sep 17 00:00:00 2001 From: Alan Antonuk Date: Sun, 19 Oct 2014 13:10:13 -0700 Subject: Enable auto_delete & internal for exchange.declare Enable auto_delete and internal parameters of amqp_exchange_declare() in codegen. These were once not generated because RabbitMQ did not support these parameters. The broker now supports these and so should we. This fixes #218 --- examples/amqp_exchange_declare.c | 2 +- examples/amqps_exchange_declare.c | 2 +- librabbitmq/amqp_framing.c | 8 +++++--- librabbitmq/amqp_framing.h | 4 +++- librabbitmq/codegen.py | 1 - 5 files changed, 10 insertions(+), 7 deletions(-) diff --git a/examples/amqp_exchange_declare.c b/examples/amqp_exchange_declare.c index 9a20a62..16ebe14 100644 --- a/examples/amqp_exchange_declare.c +++ b/examples/amqp_exchange_declare.c @@ -82,7 +82,7 @@ int main(int argc, char const *const *argv) die_on_amqp_error(amqp_get_rpc_reply(conn), "Opening channel"); amqp_exchange_declare(conn, 1, amqp_cstring_bytes(exchange), amqp_cstring_bytes(exchangetype), - 0, 0, amqp_empty_table); + 0, 0, 0, 0, amqp_empty_table); die_on_amqp_error(amqp_get_rpc_reply(conn), "Declaring exchange"); die_on_amqp_error(amqp_channel_close(conn, 1, AMQP_REPLY_SUCCESS), "Closing channel"); diff --git a/examples/amqps_exchange_declare.c b/examples/amqps_exchange_declare.c index 85a29aa..d53fa2e 100644 --- a/examples/amqps_exchange_declare.c +++ b/examples/amqps_exchange_declare.c @@ -99,7 +99,7 @@ int main(int argc, char const *const *argv) die_on_amqp_error(amqp_get_rpc_reply(conn), "Opening channel"); amqp_exchange_declare(conn, 1, amqp_cstring_bytes(exchange), amqp_cstring_bytes(exchangetype), - 0, 0, amqp_empty_table); + 0, 0, 0, 0, amqp_empty_table); die_on_amqp_error(amqp_get_rpc_reply(conn), "Declaring exchange"); die_on_amqp_error(amqp_channel_close(conn, 1, AMQP_REPLY_SUCCESS), "Closing channel"); diff --git a/librabbitmq/amqp_framing.c b/librabbitmq/amqp_framing.c index 64c30bb..76fc0cc 100644 --- a/librabbitmq/amqp_framing.c +++ b/librabbitmq/amqp_framing.c @@ -1926,12 +1926,14 @@ AMQP_CALL amqp_channel_flow(amqp_connection_state_t state, amqp_channel_t channe * @param [in] type type * @param [in] passive passive * @param [in] durable durable + * @param [in] auto_delete auto_delete + * @param [in] internal internal * @param [in] arguments arguments * @returns amqp_exchange_declare_ok_t */ AMQP_PUBLIC_FUNCTION amqp_exchange_declare_ok_t * -AMQP_CALL amqp_exchange_declare(amqp_connection_state_t state, amqp_channel_t channel, amqp_bytes_t exchange, amqp_bytes_t type, amqp_boolean_t passive, amqp_boolean_t durable, amqp_table_t arguments) +AMQP_CALL amqp_exchange_declare(amqp_connection_state_t state, amqp_channel_t channel, amqp_bytes_t exchange, amqp_bytes_t type, amqp_boolean_t passive, amqp_boolean_t durable, amqp_boolean_t auto_delete, amqp_boolean_t internal, amqp_table_t arguments) { amqp_exchange_declare_t req; req.ticket = 0; @@ -1939,8 +1941,8 @@ AMQP_CALL amqp_exchange_declare(amqp_connection_state_t state, amqp_channel_t ch req.type = type; req.passive = passive; req.durable = durable; - req.auto_delete = 0; - req.internal = 0; + req.auto_delete = auto_delete; + req.internal = internal; req.nowait = 0; req.arguments = arguments; diff --git a/librabbitmq/amqp_framing.h b/librabbitmq/amqp_framing.h index 1179012..e392dcc 100644 --- a/librabbitmq/amqp_framing.h +++ b/librabbitmq/amqp_framing.h @@ -788,12 +788,14 @@ AMQP_CALL amqp_channel_flow(amqp_connection_state_t state, amqp_channel_t channe * @param [in] type type * @param [in] passive passive * @param [in] durable durable + * @param [in] auto_delete auto_delete + * @param [in] internal internal * @param [in] arguments arguments * @returns amqp_exchange_declare_ok_t */ AMQP_PUBLIC_FUNCTION amqp_exchange_declare_ok_t * -AMQP_CALL amqp_exchange_declare(amqp_connection_state_t state, amqp_channel_t channel, amqp_bytes_t exchange, amqp_bytes_t type, amqp_boolean_t passive, amqp_boolean_t durable, amqp_table_t arguments); +AMQP_CALL amqp_exchange_declare(amqp_connection_state_t state, amqp_channel_t channel, amqp_bytes_t exchange, amqp_bytes_t type, amqp_boolean_t passive, amqp_boolean_t durable, amqp_boolean_t auto_delete, amqp_boolean_t internal, amqp_table_t arguments); /** * amqp_exchange_delete * diff --git a/librabbitmq/codegen.py b/librabbitmq/codegen.py index 6611716..510a071 100644 --- a/librabbitmq/codegen.py +++ b/librabbitmq/codegen.py @@ -225,7 +225,6 @@ apiMethodInfo = { "amqp_channel_open": ["out_of_band"], "amqp_channel_close": False, # needs special handling "amqp_access_request": False, # huh? - "amqp_exchange_declare": ["auto_delete", "internal"], "amqp_basic_get": False, # get-ok has content } -- cgit v1.2.1