summaryrefslogtreecommitdiff
path: root/tools
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 /tools
parent317a56cfffb05e72713bfa8a8e7236b7c39ddb8d (diff)
downloadrabbitmq-c-github-ask-a2a91f532b7e648b2468acad39ae7169ac020d0a.tar.gz
Fix code formatting to match the rest of the lib
Diffstat (limited to 'tools')
-rw-r--r--tools/common.c37
1 files changed, 23 insertions, 14 deletions
diff --git a/tools/common.c b/tools/common.c
index c1844ae..0c61d16 100644
--- a/tools/common.c
+++ b/tools/common.c
@@ -209,14 +209,22 @@ struct poptOption connect_options[] = {
"the password to login with", "password"
},
#ifdef WITH_SSL
- {"ssl", 0, POPT_ARG_NONE, &amqp_ssl, 0,
- "connect over SSL/TLS", NULL},
- {"cacert", 0, POPT_ARG_STRING, &amqp_cacert, 0,
- "path to the CA certificate file", "cacert.pem"},
- {"key", 0, POPT_ARG_STRING, &amqp_key, 0,
- "path to the client private key file", "key.pem"},
- {"cert", 0, POPT_ARG_STRING, &amqp_cert, 0,
- "path to the client certificate file", "cert.pem"},
+ {
+ "ssl", 0, POPT_ARG_NONE, &amqp_ssl, 0,
+ "connect over SSL/TLS", NULL
+ },
+ {
+ "cacert", 0, POPT_ARG_STRING, &amqp_cacert, 0,
+ "path to the CA certificate file", "cacert.pem"
+ },
+ {
+ "key", 0, POPT_ARG_STRING, &amqp_key, 0,
+ "path to the client private key file", "key.pem"
+ },
+ {
+ "cert", 0, POPT_ARG_STRING, &amqp_cert, 0,
+ "path to the client certificate file", "cert.pem"
+ },
#endif /* WITH_SSL */
{ NULL, '\0', 0, NULL, 0, NULL, NULL }
};
@@ -234,7 +242,7 @@ static void init_connection_info(struct amqp_connection_info *ci)
if (amqp_url)
die_amqp_error(amqp_parse_url(strdup(amqp_url), ci),
- "Parsing URL '%s'", amqp_url);
+ "Parsing URL '%s'", amqp_url);
if (amqp_server) {
char *colon;
@@ -253,7 +261,7 @@ static void init_connection_info(struct amqp_connection_info *ci)
--url now allows connection options to be
specificied concisely. */
fprintf(stderr, "Specifying the port number with"
- " --server is deprecated\n");
+ " --server is deprecated\n");
host_len = colon - amqp_server;
ci->host = malloc(host_len + 1);
@@ -353,11 +361,12 @@ amqp_connection_state_t make_connection(void)
}
amqp_set_socket(conn, socket);
die_rpc(amqp_login(conn, ci.vhost, 0, 131072, 0,
- AMQP_SASL_METHOD_PLAIN,
- ci.user, ci.password),
- "logging in to AMQP server");
- if (!amqp_channel_open(conn, 1))
+ AMQP_SASL_METHOD_PLAIN,
+ ci.user, ci.password),
+ "logging in to AMQP server");
+ if (!amqp_channel_open(conn, 1)) {
die_rpc(amqp_get_rpc_reply(conn), "opening channel");
+ }
return conn;
}