diff options
author | Alan Antonuk <alan.antonuk@gmail.com> | 2015-04-19 22:11:32 -0700 |
---|---|---|
committer | Alan Antonuk <alan.antonuk@gmail.com> | 2015-04-19 22:11:32 -0700 |
commit | 8d1d5ccf6244c6b290318ef92ec7307e32917464 (patch) | |
tree | 0a3ee0534fcd9e24b4171e4f4b683802af966d44 /librabbitmq/amqp_api.c | |
parent | c745aca12166b086d58dc9c8ededa4896529e2d1 (diff) | |
download | rabbitmq-c-8d1d5ccf6244c6b290318ef92ec7307e32917464.tar.gz |
Simplify the timer/timeout logic.
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
Diffstat (limited to 'librabbitmq/amqp_api.c')
-rw-r--r-- | librabbitmq/amqp_api.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/librabbitmq/amqp_api.c b/librabbitmq/amqp_api.c index 79e78c5..c5a999d 100644 --- a/librabbitmq/amqp_api.c +++ b/librabbitmq/amqp_api.c @@ -198,7 +198,7 @@ int amqp_basic_publish(amqp_connection_state_t state, } if (current_timestamp > state->next_recv_heartbeat) { - res = amqp_try_recv(state, current_timestamp); + res = amqp_try_recv(state); if (AMQP_STATUS_TIMEOUT == res) { return AMQP_STATUS_HEARTBEAT_TIMEOUT; } else if (AMQP_STATUS_OK != res) { |