summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 7da79af)
raw | patch | inline | side by side (parent: 7da79af)
author | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Fri, 7 Nov 2008 13:51:24 +0000 (13:51 +0000) | ||
committer | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Fri, 7 Nov 2008 13:51:24 +0000 (13:51 +0000) |
when any of the time stamp values are invalid. This is similar to
RRDTool's normal behavior. Removed the complex logic previously used to
return error codes to the user.
This solves a bug where non-advancing timestamps could have produced
incorrect error output during "BATCH" mode. The bug was cause by using
the sock->wbuf pointer for the error output. -- kevin brintnall
git-svn-id: svn://svn.oetiker.ch/rrdtool/trunk/program@1648 a5681a0c-68f1-0310-ab6d-d61299d08faa
RRDTool's normal behavior. Removed the complex logic previously used to
return error codes to the user.
This solves a bug where non-advancing timestamps could have produced
incorrect error output during "BATCH" mode. The bug was cause by using
the sock->wbuf pointer for the error output. -- kevin brintnall
git-svn-id: svn://svn.oetiker.ch/rrdtool/trunk/program@1648 a5681a0c-68f1-0310-ab6d-d61299d08faa
src/rrd_daemon.c | patch | blob | history |
diff --git a/src/rrd_daemon.c b/src/rrd_daemon.c
index c6211a6f97f9190058a1b6391c435d266ee47708..52e9f12ba06301157db4a80ea4dce0164d19d490 100644 (file)
--- a/src/rrd_daemon.c
+++ b/src/rrd_daemon.c
{
char *file, file_tmp[PATH_MAX];
int values_num = 0;
- int bad_timestamps = 0;
int status;
char orig_buf[CMD_MAX];
stamp = strtol(value, &eostamp, 10);
if (eostamp == value || eostamp == NULL || *eostamp != ':')
{
- ++bad_timestamps;
- add_response_info(sock, "Cannot find timestamp in '%s'!\n", value);
- continue;
+ pthread_mutex_unlock(&cache_lock);
+ return send_response(sock, RESP_ERR,
+ "Cannot find timestamp in '%s'!\n", value);
}
else if (stamp <= ci->last_update_stamp)
{
- ++bad_timestamps;
- add_response_info(sock,
- "illegal attempt to update using time %ld when"
- " last update time is %ld (minimum one second step)\n",
- stamp, ci->last_update_stamp);
- continue;
+ pthread_mutex_unlock(&cache_lock);
+ return send_response(sock, RESP_ERR,
+ "illegal attempt to update using time %ld when last"
+ " update time is %ld (minimum one second step)\n",
+ stamp, ci->last_update_stamp);
}
else
ci->last_update_stamp = stamp;
pthread_mutex_unlock (&cache_lock);
if (values_num < 1)
- {
- /* journal replay mode */
- if (sock == NULL) return RESP_ERR;
-
- /* if we had only one update attempt, then return the full
- error message... try to get the most information out
- of the limited error space allowed by the protocol
- */
- if (bad_timestamps == 1)
- return send_response(sock, RESP_ERR, "%s", sock->wbuf);
- else
- return send_response(sock, RESP_ERR,
- "No values updated (%d bad timestamps).\n",
- bad_timestamps);
- }
+ return send_response(sock, RESP_ERR, "No values updated.\n");
else
return send_response(sock, RESP_OK,
"errors, enqueued %i value(s).\n", values_num);