summaryrefslogtreecommitdiff
path: root/librabbitmq
diff options
context:
space:
mode:
authorDavid Wragg <david@rabbitmq.com>2010-10-21 17:49:04 +0100
committerDavid Wragg <david@rabbitmq.com>2010-10-21 17:49:04 +0100
commit866dbff8467ab7ff75cfd3d2af50d0aeb6ab0b37 (patch)
tree828f001475feb92ccca0482070eb27edb17041ff /librabbitmq
parent1017649c403f5654849ba8743bb4688ec8a7c4ff (diff)
downloadrabbitmq-c-github-ask-866dbff8467ab7ff75cfd3d2af50d0aeb6ab0b37.tar.gz
Clean up a fairly odd bit of code
Diffstat (limited to 'librabbitmq')
-rw-r--r--librabbitmq/amqp_socket.c19
1 files changed, 5 insertions, 14 deletions
diff --git a/librabbitmq/amqp_socket.c b/librabbitmq/amqp_socket.c
index a29f5c3..8693b4d 100644
--- a/librabbitmq/amqp_socket.c
+++ b/librabbitmq/amqp_socket.c
@@ -96,21 +96,12 @@ int amqp_open_socket(char const *hostname,
return sockfd;
}
-static char *header() {
- static char header[8];
- header[0] = 'A';
- header[1] = 'M';
- header[2] = 'Q';
- header[3] = 'P';
- header[4] = 0;
- header[5] = AMQP_PROTOCOL_VERSION_MAJOR;
- header[6] = AMQP_PROTOCOL_VERSION_MINOR;
- header[7] = AMQP_PROTOCOL_VERSION_REVISION;
- return header;
-}
-
int amqp_send_header(amqp_connection_state_t state) {
- return send(state->sockfd, header(), 8, 0);
+ static const uint8_t header[8] = { 'A', 'M', 'Q', 'P', 0,
+ AMQP_PROTOCOL_VERSION_MAJOR,
+ AMQP_PROTOCOL_VERSION_MINOR,
+ AMQP_PROTOCOL_VERSION_REVISION };
+ return send(state->sockfd, header, 8, 0);
}
static amqp_bytes_t sasl_method_name(amqp_sasl_method_enum method) {