From: Bruno Prémont Date: Mon, 2 Mar 2009 08:24:39 +0000 (+0100) Subject: contrib/php-collection: A few more bug-fixes to the graphing scripts. X-Git-Tag: collectd-4.6.2~5^2~12 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=40e1a7b6e94b65320842ba0239f1d10757e1a571;p=collectd.git contrib/php-collection: A few more bug-fixes to the graphing scripts. This removes some obsolete code which prevents flush from working and adds missing wrapper error500(). --- diff --git a/contrib/php-collection/functions.php b/contrib/php-collection/functions.php index 9fb6116f..cb916abe 100644 --- a/contrib/php-collection/functions.php +++ b/contrib/php-collection/functions.php @@ -260,17 +260,6 @@ function collectd_flush($identifier) { if (is_null($identifier) || (is_array($identifier) && count($identifier) == 0) || !(is_string($identifier) || is_array($identifier))) return false; - if (is_null($host) || !is_string($host) || strlen($host) == 0) - return false; - if (is_null($plugin) || !is_string($plugin) || strlen($plugin) == 0) - return false; - if (is_null($pinst) || !is_string($pinst)) - return false; - if (is_null($type) || !is_string($type) || strlen($type) == 0) - return false; - if (is_null($tinst) || (is_array($tinst) && count($tinst) == 0) || !(is_string($tinst) || is_array($tinst))) - return false; - $u_errno = 0; $u_errmsg = ''; if ($socket = @fsockopen($config['collectd_sock'], 0, $u_errno, $u_errmsg)) { diff --git a/contrib/php-collection/graph.php b/contrib/php-collection/graph.php index e5365768..17749e06 100644 --- a/contrib/php-collection/graph.php +++ b/contrib/php-collection/graph.php @@ -112,6 +112,13 @@ function error400($title, $msg) { return error(400, "Bad request", $title, $msg); } +/** + * Incomplete / invalid request + */ +function error500($title, $msg) { + return error(500, "Internal error", $title, $msg); +} + // Process input arguments $host = read_var('host', $_GET, null); if (is_null($host))