summaryrefslogtreecommitdiff
path: root/librabbitmq
Commit message (Collapse)AuthorAgeFilesLines
* Remove vim mode lines.formatAlan Antonuk2017-12-0426-26/+0
| | | | They're hard to keep in sync with .clang-format or other tools.
* Calling va_start with enum is undefined behavior, replaced enum with ↵kokan2017-09-121-2/+2
| | | | | | compatible int. Signed-off-by: kokan <peter.kokai@balabit.com>
* Lib: simplify the byte-swap codeAlan Antonuk2017-08-202-135/+123
|
* Fix: correct spelling of comment in amqp.hAlan Antonuk2017-08-201-1/+1
|
* Add AMQP_DEFAULT_VHOST define for "/"Alan Antonuk2017-08-201-0/+11
| | | | | | Add a #define for AMQP_DEFAULT_VHOST pointing to "/", which is the default vhost used by the RabbitMQ broker. This makes the code a bit more readable, especially in example code.
* amqp_consume_message: replace AMQP_STATUS_UNEXPECTED_FRAME in docstringDavid Sharp2017-08-021-2/+2
| | | | | The documentation for amqp_consume_message refers to AMQP_STATUS_UNEXPECTED_FRAME, but this value doesn't exist. The correct value appears to be AMQP_STATUS_UNEXPECTED_STATE to match the implementation and amqp_consumer.c example. https://github.com/alanxz/rabbitmq-c/blob/master/examples/amqp_consumer.c#L85
* Lib: simplify socket connection logicconn-tryAlan Antonuk2017-07-251-163/+154
| | | | | | | | | | | | Refactor amqp_socket_open_inner so that the socket connection logic is in it's own OS-specific socket_connect function, and the host resolution and retry logic calls this. This makes the socket connection logic easier to understand and reduces the number of win32 #ifdefs. This also fixes an issue where multiple hostnames are not tried if connect doesn't fail immediately. Fixes #430
* Properly deinit of OpenSSLJesus Fernandez Manzano2017-06-221-0/+12
|
* TCP Keep alive for RabbitMQ ClientKetan Kulkarni2017-03-251-0/+6
| | | | | | - Enable TCP Keep Alive for rabbitmq client - Helps in cases when the connection is conntracked or there is NAT in between
* Lib: Do not set MSG_MORE on last message header if no body followsMartin Willi2017-03-231-2/+7
| | | | | | | | | | | | | Introduced with commit 2bc1f9b1b0 (lib: use MSG_MORE on Linux for basic.publish), amqp_basic_publish() sets MSG_MORE on all but the last send() syscall it triggers on the TCP socket to improve performance. However, if no message body is provided, no completing call without MSG_MORE follows, keeping the TCP packet pending. On Linux, this may introduce a message send delay, until the kernel sends out the data anyway after 200ms. This may add a significant delay if a consumer is waiting for such an empty (confirmation) message.
* Lib: add methods to set timeout of AMQP RPCsrpc-timeoutAlan Antonuk2017-03-154-19/+104
| | | | Fixes #403
* Lib: close socket when amqp_login fails.Alan Antonuk2017-03-151-4/+2
|
* Lib: simplify reply generation in simple_rpc_innerAlan Antonuk2017-03-011-9/+3
|
* Doc: fix typo in amqp_get_handshake_timeout commentAlan Antonuk2017-03-011-1/+1
|
* Win32: use SRWLOCK instead of CRITIAL_SECTIONAlan Antonuk2017-02-203-46/+16
| | | | | | | | | | SRWLOCK allows for static-initialization of the lock, matching the semantics of pthread_mutex that is used in OpenSSL bits, simplifying the code somewhat. Note that this API only became available in Windows Vista and newer. Given Windows XP and Windows Server 2003 are no longer supported by Microsoft, using this newer API is an acceptable tradeoff.
* ssl: Add OpenSSL BIO that passes MSG_NOSIGNALssl_bioAlan Antonuk2017-02-204-4/+207
| | | | | | | Add an OpenSSL BIO that ignores SIGPIPE by passing MSG_NOSIGNAL to the send() and recv() calls on platforms that support it. Fixes #401
* Lib: re-order NULL check in empty_blocklistAlan Antonuk2016-12-041-3/+3
| | | | | | | NULL check in empty_blockless was happening after its used. This would've likely resulted in crashes if it was hit. Found with PVS Studio run.
* Lib: add timeout for amqp_login and friendspr383Haster2016-11-276-72/+205
| | | | | | | | | | | By default the RabbitMQ broker sets a tunable timeout of 10 seconds from socket-open to successful handshake. This introduces a similar login timeout on the client side. If the login does not complete within this timeout, amqp_login and friends will return AMQP_STATUS_TIMEOUT and the connection will be considered dead. Two new functions amqp_set_handshake_timeout and amqp_get_handshake_timeout are introduced to tune this behavior.
* Fix: add ABI AMQP_CALL decorator on public functionsmissing_callAlan Antonuk2016-11-101-0/+3
| | | | | amqp_get_socket, amqp_get_server_properties, amqp_get_client_properites were missing AMQP_CALL decorator.
* - Modified to enable cross-compilation with mingw-w64 cross compiler.Darmawan Salihun2016-10-146-11/+11
|
* removed /Z7 key when using non-Microsoft compilerpr373EvilBeaver2016-09-181-3/+8
|
* Lib: simplify empty-bytes assignment in amqp_login.ub-fixAlan Antonuk2016-08-201-2/+1
|
* Lib: fix undefined behavior in amqp_encode_bytesAlan Antonuk2016-08-201-0/+7
| | | | | | Passing a NULL pointer to the src parameter of memcpy results in undefined behavior even if the len parameter is 0. Fix is to check for the length before attempting to memcpy.
* Docs: add AMQP_SASL_METHOD_EXTERNAL documentation.sasl-docsAlan Antonuk2016-08-201-8/+16
| | | | | | | Add docs to amqp_login* functions on how to correctly use AMQP_SASL_METHOD_EXTERNAL to authenticate to the broker. Fixes #349
* Add NORETURN macro for MSVCJakub Stefański2016-04-211-0/+4
|
* Fix duplicate WIN32_LEAN_AND_MEAN definitionJakub Stefański2016-04-211-1/+3
|
* Bumping revision for development.ver_bumpAlan Antonuk2016-04-101-2/+2
|
* Preparation for v0.8.0 release.v0.8.0release_080Alan Antonuk2016-04-091-1/+1
|
* Lib: correct types in ENFORCE_STATE macro.win32_warn2Alan Antonuk2016-04-091-9/+9
|
* Lib: remove unreachable return statementsAlan Antonuk2016-04-093-4/+2
|
* Lib: correct sign conversion issue in amqp_url.cAlan Antonuk2016-04-091-2/+3
|
* Lib: add bounds check on amqp_login inputsAlan Antonuk2016-04-091-13/+35
| | | | | Check bounds on channel_max, frame_max, and heartbeat arguments to amqp_login* functions.
* Lib: check out of range args in amqp_*_close() fn.Alan Antonuk2016-04-091-2/+10
| | | | | Check for code parameter being between 0 -> UINT16_MAX in amqp_connection_close() and amqp_channel_close() functions.
* Lib: add amqp_rpc_reply_error convenience functionAlan Antonuk2016-04-091-0/+7
| | | | | Add internal function to construct amqp_rpc_reply_t that are library errors.
* Lib: correct input type to ioctlsocket on win32Alan Antonuk2016-04-091-1/+1
|
* Lib: fix shadowed variable in wait_frame_innerAlan Antonuk2016-04-091-2/+0
|
* Lib: use for(;;) for infinite loopAlan Antonuk2016-04-091-2/+2
|
* Lib: add missing type info on win32 in socket_initAlan Antonuk2016-04-091-1/+1
|
* CMake: Remove install_pdb macro.Alan Antonuk2016-04-091-3/+0
|
* Win32: embed debug info in static-libraryAlan Antonuk2016-04-091-2/+6
| | | | | Use /Z7 with MSVC to embed debug information in the static library instead of generating a .pdb file.
* Documentation of amqp_basic_publish references wrong AMQP methodpr340sigiesec2016-02-021-2/+2
| | | | | | | The documentation of amqp_basic_publish incorrectly states that the broker will respond with a basic.reject method in case of failures when the mandatory or immediate flags are set. Actually, this is the basic.return method.
* Lib: don't use TCP_NOPUSH under cygwincygwin_nopushAlan Antonuk2016-01-121-1/+3
| | | | | | | Cygwin defines TCP_NOPUSH, but fails with an error when you try to use it. Disable it on Cygwin. Fixes #335
* Lib: amqp_frame_to_bytes: use temp bytes_tAlan Antonuk2015-12-251-4/+8
| | | | | | | Use temporary amqp_bytes_t to encode properties instead of using the encoded input parameter. Coverity CID: 1345884
* Lib: fix incorrect hostname check return valueAlan Antonuk2015-11-301-33/+14
| | | | | | | | amqp_ssl_socket_verify_hostname returns 1 on success, 0 on not found, and -1 on error. Refactor this code to be less error-prone and not use magic numbers in return values. Fixes #330
* Lib: fix size_t conversion issues in openssl.cAlan Antonuk2015-11-291-7/+24
|
* Win32: fix missing definition of malloc warning.Alan Antonuk2015-11-291-0/+2
|
* Lib: use amqp_cstring_bytes to construct stringAlan Antonuk2015-11-291-4/+2
| | | | | Use amqp_cstring_bytes to construct string instead of doing it manually as this is error-prone.
* Lib: memset based on size of argument.Alan Antonuk2015-11-281-5/+5
|
* Lib: correctly check SSL connectionInsu Yun2015-11-271-0/+10
| | | | | | | | | | | According to "https://www.openssl.org/docs/manmaster/ssl/SSL_get_verify_result.html", to verify SSL connection result, SSL_get_verify_result() needs to be called with SSL_get_peer_certificate(). In default mode, which verify_peer and verify_hostname are activated, then there is no problem because in verify_hostname, the existence of certificate is confirmed. However, it is possible that the user want to verify_peer, but not verify_host. In such case, it is not working as they wanted. Because with invalid certificate, the attacker can bypass certificate validity check.
* Lib: don't pass NULL to memcpy in amqp_table.cscan-build-fixesAlan Antonuk2015-11-101-5/+13
| | | | Issue surfaced by clang static-analyzer v3.5.