summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: baa2269)
raw | patch | inline | side by side (parent: baa2269)
author | Ruben Kerkhof <ruben@rubenkerkhof.com> | |
Mon, 1 Aug 2016 20:05:11 +0000 (22:05 +0200) | ||
committer | Ruben Kerkhof <ruben@rubenkerkhof.com> | |
Mon, 1 Aug 2016 20:05:11 +0000 (22:05 +0200) |
src/amqp.c | patch | blob | history |
diff --git a/src/amqp.c b/src/amqp.c
index 9a20f4a119a9bbdf9a34c090559675d7f972caa1..9bc3175cebaf0dd25c5a1188f4099e10426ccaac 100644 (file)
--- a/src/amqp.c
+++ b/src/amqp.c
static int camqp_write_locked (camqp_config_t *conf, /* {{{ */
const char *buffer, const char *routing_key)
{
- amqp_basic_properties_t props = { 0 };
int status;
status = camqp_connect (conf);
if (status != 0)
return (status);
- props._flags = AMQP_BASIC_CONTENT_TYPE_FLAG
- | AMQP_BASIC_DELIVERY_MODE_FLAG
- | AMQP_BASIC_APP_ID_FLAG;
+ amqp_basic_properties_t props = {
+ ._flags = AMQP_BASIC_CONTENT_TYPE_FLAG
+ | AMQP_BASIC_DELIVERY_MODE_FLAG
+ | AMQP_BASIC_APP_ID_FLAG,
+ .delivery_mode = conf->delivery_mode,
+ .app_id = amqp_cstring_bytes("collectd")
+ };
+
if (conf->format == CAMQP_FORMAT_COMMAND)
props.content_type = amqp_cstring_bytes("text/collectd");
else if (conf->format == CAMQP_FORMAT_JSON)
props.content_type = amqp_cstring_bytes("text/graphite");
else
assert (23 == 42);
- props.delivery_mode = conf->delivery_mode;
- props.app_id = amqp_cstring_bytes("collectd");
status = amqp_basic_publish(conf->connection,
/* channel = */ 1,