diff options
author | Tony Garnock-Jones <tonygarnockjones@gmail.com> | 2010-02-18 16:31:41 +1300 |
---|---|---|
committer | Tony Garnock-Jones <tonygarnockjones@gmail.com> | 2010-02-18 16:31:41 +1300 |
commit | c3cd7377d67b46e44b7c2d09e70a6aabecbbee9e (patch) | |
tree | 9d43f268f662dbe180d93ccc6ed45eb608ab6afe /librabbitmq | |
parent | db588e046a75e143ceec44802b80fb42ee668a7b (diff) | |
download | rabbitmq-c-github-ask-c3cd7377d67b46e44b7c2d09e70a6aabecbbee9e.tar.gz |
Pay attention to result of amqp_login_inner
Diffstat (limited to 'librabbitmq')
-rw-r--r-- | librabbitmq/amqp_socket.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/librabbitmq/amqp_socket.c b/librabbitmq/amqp_socket.c index 0149e7c..cf38dea 100644 --- a/librabbitmq/amqp_socket.c +++ b/librabbitmq/amqp_socket.c @@ -379,10 +379,18 @@ amqp_rpc_reply_t amqp_login(amqp_connection_state_t state, { va_list vl; amqp_rpc_reply_t result; + int status; va_start(vl, sasl_method); - amqp_login_inner(state, channel_max, frame_max, heartbeat, sasl_method, vl); + status = amqp_login_inner(state, channel_max, frame_max, heartbeat, sasl_method, vl); + if (status <= 0) { + result.reply_type = AMQP_RESPONSE_LIBRARY_EXCEPTION; + result.reply.id = 0; + result.reply.decoded = NULL; + result.library_errno = -status; + return result; + } { amqp_connection_open_t s = |