summaryrefslogtreecommitdiff
path: root/librabbitmq/amqp_socket.c
Commit message (Collapse)AuthorAgeFilesLines
* Check for heartbeats when in blocking send.timer_refactorAlan Antonuk2015-05-031-2/+10
| | | | | | | Check for recv heartbeats when blocking on sending to the socket. A blocked send can indicate that the broker is applying backpressure to publishers, it could also be that the TCP connection is dead, checking for recv heartbeats can give an earlier indication that the connection is broken.
* Remove writev specific code.Alan Antonuk2015-05-031-50/+0
|
* Fixup of commentAlan Antonuk2015-05-031-1/+1
|
* Extract poll selection from send/writevAlan Antonuk2015-05-031-30/+19
|
* Extract deadline as param of try_writev/try_sendAlan Antonuk2015-05-031-16/+3
|
* Refactor heartbeat timeout code to be simplerAlan Antonuk2015-05-031-78/+23
| | | | | Refactor the heartbeat timeout code to hopefully simplify it and hopefully make it less hairy to deal with in the future.
* Rename amqp_timer_t related functions.Alan Antonuk2015-05-031-27/+27
| | | | | Rename amqp_timer_t related functions to improve readability of the code and clarify what they do.
* Rename amqp_timer.[ch] to amqp_time.[ch].Alan Antonuk2015-05-031-1/+1
| | | | Rename the files to better reflect the functions that they contain.
* Correct buffer recalc error in amqp_try_sendAlan Antonuk2015-04-301-1/+1
| | | | | This one only shows up when send() does a partial read, which is why it wasn't caught immediately. Need some better tests for this.
* Simplify the timer/timeout logic.Alan Antonuk2015-04-191-125/+61
| | | | | | | | | | | Instead of passing around a start time and timeout interval, calculate this early and pass around the timeout value (as a implementation detail), then calculate against current timestamp. This simplifies the code, gives a more realistic 'timeout' for the function at the cost of potentially a few more timer pings. Conflicts: librabbitmq/amqp_socket.c
* Refactor read/write poll function usage.Alan Antonuk2015-04-191-88/+72
|
* Add support for send/writev in non-blocking modeAlan Antonuk2015-04-191-5/+157
|
* Add support for non-blocking read in rabbitmq-cAlan Antonuk2015-04-191-58/+60
|
* Leave socket as non-blocking after connectAlan Antonuk2015-04-191-12/+0
|
* Simplify amqp_open_socket_nonblock.Alan Antonuk2015-04-191-80/+65
|
* fix WSAEINVAL WSAPoll due to POLERR in eventsIvan Efimov2015-04-081-1/+1
|
* Unit test for verify sasl mechanismsBhasker Allam2015-04-051-2/+2
|
* Add error codes for unsupported SASL type.Bhasker Allam2015-04-051-0/+1
| | | | | Add error codes and associated error strings when the broker does not support the desired SASL method.
* Add EXTERNAL SASL mechanism.Alan Antonuk2015-04-051-0/+67
|
* Update copyright on files changed in 2014.Alan Antonuk2014-08-261-1/+1
|
* Add platform, version, copyright client propertiesAlan Antonuk2014-08-251-2/+20
| | | | | | | | | 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 <jonathan.de.boyne.pollard@synety.com>
* Fix: remove superfulous assignment in amqp_socket.cAlan Antonuk2014-07-271-1/+0
| | | | | sockfd is assigned, then assigned again unconditionally without being read from. There's no point in this statement, so lets get rid of it.
* FIX: Improve invalid frame detection code.Alan Antonuk2014-07-141-0/+2
| | | | | | | | Improve detection of invalid AMQP frame header before allocating frame buffer. This fixes #187. Thanks to Mike Stitt <mikes@spindance.com> for the inspiration on this.
* Fixed timeval to milliseconds calculation errorjestor2014-05-081-1/+1
| | | milliseconds = seconds * 1000 + microseconds / 1000
* Use poll(2) for timeouts on socketAlan Antonuk2014-04-141-16/+31
| | | | | | | 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
* Right unexpected frames requeue in amqp_consumer.cOleg Blednov2013-11-051-3/+32
|
* Add amqp_get_broker_properties() functionAlan Antonuk2013-08-151-0/+7
| | | | | Add function to return the properties table advertised by the broker on connection to the broker.
* FIX: amqp_open_socket not defined.Alan Antonuk2013-07-231-0/+7
| | | | | This fixes a regression introduced in 6ad770dc where the amqp_open_socket() function is no longer defined.
* FIX: Incorrect assert in wait_frame_innerAlan Antonuk2013-07-081-3/+0
| | | | | | | | Probably introduced when consume_one_frame() function was added, and wasn't found during testing because its rare to see partial recv of frame when testing locally. Need to devise a test for this. Fixes #126
* Add a high level API for consuming messagesAlan Antonuk2013-07-081-0/+74
|
* Make sure date math is done in 64-bit precAlan Antonuk2013-07-061-4/+5
| | | | | Some platforms declare tv.tv_sec and tv.tv_usec as long which is 32-bit which will integer overflow in our date math
* Add nonblocking connect supportzaq178miami2013-07-061-9/+176
|
* Get rid of amqp_socket_error interfaceAlan Antonuk2013-07-031-8/+0
| | | | | Get rid of experimental amqp_socket_error interface. Errors are returned using the error codes from the primary function
* Make connection the socket object ownerAlan Antonuk2013-07-031-5/+10
| | | | | | | | Improve the socket interface by making the amqp_connection_state_t object the amqp_socket_t owner, and tie its lifetime to the connection's lifetime. This prevents a class of silly errors where the socket object isn't freed, or the socket object is assigned to two different connection objects
* Code clarity improvements in heartbeat handlingAlan Antonuk2013-06-261-5/+5
|
* Add support for heartbeats in amqp_basic_publishAlan Antonuk2013-06-251-100/+207
| | | | | Check heartbeats when doing basic.publish. Do this by doing a recv on the socket.
* Add partial support for heartbeats in wait_frameAlan Antonuk2013-06-251-13/+64
|
* FIX: disable SIGPIPE on platforms w/SO_NOSIGPIPEAlan Antonuk2013-06-251-2/+2
| | | | | The DISABLE_SIGPIPE_WITH_SETSOCKOPT preprocessor define got deleted the os-layer socket functions were moved to amqp_socket.c. This fixes that.
* Channel-based memory managementAlan Antonuk2013-06-211-5/+24
| | | | | | Assign a decoding pool on a per-channel basis. This allows memory to be released on a per-channel basis which is helpful for clients handling multiple channels
* FIX: handle amqp_get_sockfd failure in wait_frameAlan Antonuk2013-06-181-0/+3
| | | | | CID 1035138 CID 1035137
* Add amqp_simple_wait_frame_noblock() functionAlan Antonuk2013-06-141-3/+79
| | | | | | Add non-blocking variant of amqp_simple_wait_frame() to assist clients in writing programs that want non-blocking behavior when consuming messages from the broker.
* Fix latent bugs with return error-codesAlan Antonuk2013-06-141-8/+4
|
* Set state->socket to NULL after amqp_socket_closeAlan Antonuk2013-06-141-0/+1
| | | | | amqp_socket_close has the side-effect of destroying the socket object. Use after this will cause undefined behavior
* Move amqp_os_socket* funcs to amqp_socket.h/cAlan Antonuk2013-06-131-10/+109
| | | | | Doing this for code clarity, as its easier to see what the issues are when you have all implementations in one file
* Improve error handling in socket functionsAlan Antonuk2013-06-131-5/+8
|
* Don't abort() in amqp_simple_wait_frame()Alan Antonuk2013-06-131-17/+5
| | | | | | | amqp_simple_wait_method() should not call abort(), instead close the underlying socket, then return AMQP_STATUS_WRONG_METHOD. This is still rather heavy-handed for a public API, however, its a lot better than killing the entire application
* Expose public error-code interfaceAlan Antonuk2013-06-131-22/+22
| | | | | | | | | | Publicly define the error codes returned from the various public API functions. The error codes are defined in the amqp_status_enum and are all negative in value to work with functions that return positive values. OS and SSL specific codes are no longer munged into the error code, as it is unlikely for that information to be useful to library users.
* FIX: missing va_end in amqp_login* functionsAlan Antonuk2013-05-251-4/+14
| | | | | Be sure to va_end any va_start'ed va_lists in amqp_login and amqp_login_with_properties
* FIX/Win32: properly munge amqp_socket_initAlan Antonuk2013-04-171-2/+3
| | | | | | Properly munge the error code from amqp_socket_init on Win32, previously it was not munged correctly and an error code could be mistaken as a sockfd
* Fix code formatting to match the rest of the libAlan Antonuk2013-04-171-30/+27
|