summaryrefslogtreecommitdiff
path: root/librabbitmq/amqp_socket.c
diff options
context:
space:
mode:
authorAlan Antonuk <alan.antonuk@gmail.com>2013-04-11 10:53:59 -0700
committerAlan Antonuk <alan.antonuk@gmail.com>2013-04-17 09:56:29 -0700
commita2a91f532b7e648b2468acad39ae7169ac020d0a (patch)
tree78010b44a0e00011cc17787d144abc7dc358c560 /librabbitmq/amqp_socket.c
parent317a56cfffb05e72713bfa8a8e7236b7c39ddb8d (diff)
downloadrabbitmq-c-github-ask-a2a91f532b7e648b2468acad39ae7169ac020d0a.tar.gz
Fix code formatting to match the rest of the lib
Diffstat (limited to 'librabbitmq/amqp_socket.c')
-rw-r--r--librabbitmq/amqp_socket.c57
1 files changed, 27 insertions, 30 deletions
diff --git a/librabbitmq/amqp_socket.c b/librabbitmq/amqp_socket.c
index 559be47..130d19a 100644
--- a/librabbitmq/amqp_socket.c
+++ b/librabbitmq/amqp_socket.c
@@ -141,22 +141,19 @@ int amqp_open_socket(char const *hostname,
http://stackoverflow.com/questions/1953639/is-it-safe-to-cast-socket-to-int-under-win64
*/
sockfd = (int)socket(addr->ai_family, addr->ai_socktype, addr->ai_protocol);
- if (-1 == sockfd)
- {
+ if (-1 == sockfd) {
last_error = -amqp_os_socket_error();
continue;
}
#ifdef DISABLE_SIGPIPE_WITH_SETSOCKOPT
- if (0 != amqp_socket_setsockopt(sockfd, SOL_SOCKET, SO_NOSIGPIPE, &one, sizeof(one)))
- {
+ if (0 != amqp_socket_setsockopt(sockfd, SOL_SOCKET, SO_NOSIGPIPE, &one, sizeof(one))) {
last_error = -amqp_os_socket_error();
amqp_os_socket_close(sockfd);
continue;
}
#endif /* DISABLE_SIGPIPE_WITH_SETSOCKOPT */
if (0 != amqp_socket_setsockopt(sockfd, IPPROTO_TCP, TCP_NODELAY, &one, sizeof(one))
- || 0 != connect(sockfd, addr->ai_addr, addr->ai_addrlen))
- {
+ || 0 != connect(sockfd, addr->ai_addr, addr->ai_addrlen)) {
last_error = -amqp_os_socket_error();
amqp_os_socket_close(sockfd);
continue;
@@ -406,14 +403,14 @@ retry:
*/
if (!((frame.frame_type == AMQP_FRAME_METHOD)
&& (
- ((frame.channel == channel)
- && (amqp_id_in_reply_list(frame.payload.method.id, expected_reply_ids)
- || (frame.payload.method.id == AMQP_CHANNEL_CLOSE_METHOD)))
- ||
- ((frame.channel == 0)
- && (frame.payload.method.id == AMQP_CONNECTION_CLOSE_METHOD))
- )
- )) {
+ ((frame.channel == channel)
+ && (amqp_id_in_reply_list(frame.payload.method.id, expected_reply_ids)
+ || (frame.payload.method.id == AMQP_CHANNEL_CLOSE_METHOD)))
+ ||
+ ((frame.channel == 0)
+ && (frame.payload.method.id == AMQP_CONNECTION_CLOSE_METHOD))
+ )
+ )) {
amqp_frame_t *frame_copy = amqp_pool_alloc(&state->decoding_pool, sizeof(amqp_frame_t));
amqp_link_t *link = amqp_pool_alloc(&state->decoding_pool, sizeof(amqp_link_t));
@@ -495,13 +492,13 @@ static int amqp_table_contains_entry(const amqp_table_t *table,
}
static amqp_rpc_reply_t amqp_login_inner(amqp_connection_state_t state,
- char const *vhost,
- int channel_max,
- int frame_max,
- int heartbeat,
- const amqp_table_t *client_properties,
- amqp_sasl_method_enum sasl_method,
- va_list vl)
+ char const *vhost,
+ int channel_max,
+ int frame_max,
+ int heartbeat,
+ const amqp_table_t *client_properties,
+ amqp_sasl_method_enum sasl_method,
+ va_list vl)
{
int res;
amqp_method_t method;
@@ -536,7 +533,7 @@ static amqp_rpc_reply_t amqp_login_inner(amqp_connection_state_t state,
amqp_table_t default_table;
amqp_connection_start_ok_t s;
amqp_bytes_t response_bytes = sasl_response(&state->decoding_pool,
- sasl_method, vl);
+ sasl_method, vl);
if (response_bytes.bytes == NULL) {
res = -ERROR_NO_MEMORY;
@@ -572,7 +569,7 @@ static amqp_rpc_reply_t amqp_login_inner(amqp_connection_state_t state,
amqp_table_entry_t *current_entry;
s.client_properties.entries = amqp_pool_alloc(&state->decoding_pool,
- sizeof(amqp_table_entry_t) * (default_table.num_entries + client_properties->num_entries));
+ sizeof(amqp_table_entry_t) * (default_table.num_entries + client_properties->num_entries));
if (NULL == s.client_properties.entries) {
res = -ERROR_NO_MEMORY;
goto error_res;
@@ -707,13 +704,13 @@ amqp_rpc_reply_t amqp_login(amqp_connection_state_t state,
}
amqp_rpc_reply_t amqp_login_with_properties(amqp_connection_state_t state,
- char const *vhost,
- int channel_max,
- int frame_max,
- int heartbeat,
- const amqp_table_t *client_properties,
- amqp_sasl_method_enum sasl_method,
- ...)
+ char const *vhost,
+ int channel_max,
+ int frame_max,
+ int heartbeat,
+ const amqp_table_t *client_properties,
+ amqp_sasl_method_enum sasl_method,
+ ...)
{
va_list vl;