summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: ed633b6)
raw | patch | inline | side by side (parent: ed633b6)
author | Paul Sadauskas <psadauskas@gmail.com> | |
Sat, 20 Jun 2009 21:38:28 +0000 (15:38 -0600) | ||
committer | Florian Forster <sifnfors@informatik.stud.uni-erlangen.de> | |
Mon, 6 Jul 2009 14:39:47 +0000 (16:39 +0200) |
Port was getting written to plugin_instance as "1978.00000", because
apparently that's the value returned by the config.
apparently that's the value returned by the config.
src/tokyotyrant.c | patch | blob | history |
diff --git a/src/tokyotyrant.c b/src/tokyotyrant.c
index 73a065e14330811102f669b31831edf0a52a9224..b59315cbd1493756c743f686c5e5250d1542aff3 100644 (file)
--- a/src/tokyotyrant.c
+++ b/src/tokyotyrant.c
static int config_keys_num = STATIC_ARRAY_SIZE (config_keys);
static char *host = NULL;
-
-/* int is for opening connection, string is for plugin_instance */
-static char *port_str = NULL;
static int port;
+static char port_str[5];
static int tt_config (const char *key, const char *value)
{
}
else if (strcasecmp ("Port", key) == 0)
{
- if (port_str != NULL)
- free (port_str);
- port_str = strdup(value);
-
port = atoi(value);
-
if ((port < 0) || (port > 65535))
{
ERROR ("tokyotyrant plugin: error: Port %s out of range", value);
return (-1);
}
+ ssnprintf(port_str, 5, "%i", port);
}
else
{