projects
/
collectd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
76cc183
)
amqp plugin: Use "service_name_to_port_number" to parse the "Port" config option.
author
Florian Forster
<octo@leeloo.lan.home.verplant.org>
Mon, 22 Mar 2010 18:58:33 +0000
(19:58 +0100)
committer
Florian Forster
<octo@leeloo.lan.home.verplant.org>
Wed, 4 Aug 2010 13:13:50 +0000
(15:13 +0200)
src/amqp.c
patch
|
blob
|
history
diff --git
a/src/amqp.c
b/src/amqp.c
index
23526e2
..
95cded7
100644
(file)
--- a/
src/amqp.c
+++ b/
src/amqp.c
@@
-82,7
+82,17
@@
static int config(const char *key, const char *value)
return (config_set(&host, value));
else if(strcasecmp(key, "port") == 0)
{
- port = atoi(value);
+ int tmp;
+
+ tmp = service_name_to_port_number (value);
+ if (tmp <= 0)
+ {
+ ERROR ("AMQP plugin: Cannot parse `%s' as a "
+ "service name (port number).", value);
+ return (1);
+ }
+
+ port = tmp;
return (0);
}
else if (strcasecmp(key, "vhost") == 0)