From: Florian Forster Date: Fri, 6 Aug 2010 13:12:07 +0000 (+0200) Subject: amqp plugin: Implement parsing of "PUTVAL" data. X-Git-Tag: collectd-5.0.0-beta0~28^2~11 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=28144b13e832d39bc10143ef4f5097868688f299;p=collectd.git amqp plugin: Implement parsing of "PUTVAL" data. Data transmission via AMQP works now! \o/ --- diff --git a/src/amqp.c b/src/amqp.c index 84bcc066..d3a53d7a 100644 --- a/src/amqp.c +++ b/src/amqp.c @@ -470,8 +470,28 @@ static int camqp_read_body (camqp_config_t *conf, /* {{{ */ received += frame.payload.body_fragment.len; } /* while (received < body_size) */ - DEBUG ("amqp plugin: camqp_read_body: body = %s", body); + if (conf->format == CAMQP_FORMAT_COMMAND) + { + status = handle_putval (stderr, body); + if (status != 0) + ERROR ("amqp plugin: handle_putval failed with status %i.", + status); + return (status); + } + else if (conf->format == CAMQP_FORMAT_JSON) + { + ERROR ("amqp plugin: camqp_read_body: Parsing JSON data has not " + "been implemented yet. FIXME!"); + return (0); + } + else + { + ERROR ("amqp plugin: camqp_read_body: Unknown format option (%i).", + conf->format); + return (EINVAL); + } + /* not reached */ return (0); } /* }}} int camqp_read_body */