diff options
author | Stefan Bühler <stbuehler@web.de> | 2015-02-08 12:37:10 +0000 |
---|---|---|
committer | Stefan Bühler <stbuehler@web.de> | 2015-02-08 12:37:10 +0000 |
commit | 6afad87d2ed66a48cda2a7c01dbcc59023774b73 (patch) | |
tree | 9b371e94cf911630c5794f5b4ff6e3edd6439a3b /src/mod_rrdtool.c | |
parent | 3521be8b8599ae2cc12361c8f600fc58a473de91 (diff) | |
download | lighttpd-git-6afad87d2ed66a48cda2a7c01dbcc59023774b73.tar.gz |
fix buffer, chunk and http_chunk API
* remove unused structs and functions
(buffer_array, read_buffer)
* change return type from int to void for many functions,
as the return value (indicating error/success) was never checked,
and the function would only fail on programming errors and not on
invalid input; changed functions to use force_assert instead of
returning an error.
* all "len" parameters now are the real size of the memory to be read.
the length of strings is given always without the terminating 0.
* the "buffer" struct still counts the terminating 0 in ->used,
provide buffer_string_length() to get the length of a string in a
buffer.
unset config "strings" have used == 0, which is used in some places
to distinguish unset values from "" (empty string) values.
* most buffer usages should now use it as string container.
* optimise some buffer copying by "moving" data to other buffers
* use (u)intmax_t for generic int-to-string functions
* remove unused enum values: UNUSED_CHUNK, ENCODING_UNSET
* converted BUFFER_APPEND_SLASH to inline function (no macro feature
needed)
* refactor: create chunkqueue_steal: moving (partial) chunks into another
queue
* http_chunk: added separate function to terminate chunked body instead of
magic handling in http_chunk_append_mem().
http_chunk_append_* now handle empty chunks, and never terminate the
chunked body.
From: Stefan Bühler <stbuehler@web.de>
git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2975 152afb58-edef-0310-8abb-c4023f1b3aa9
Diffstat (limited to 'src/mod_rrdtool.c')
-rw-r--r-- | src/mod_rrdtool.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/mod_rrdtool.c b/src/mod_rrdtool.c index df2a7812..4986ea34 100644 --- a/src/mod_rrdtool.c +++ b/src/mod_rrdtool.c @@ -366,7 +366,7 @@ SETDEFAULTS_FUNC(mod_rrd_set_defaults) { return HANDLER_ERROR; } - if (i > 0 && !buffer_is_empty(s->path_rrdtool_bin)) { + if (i > 0 && !buffer_string_is_empty(s->path_rrdtool_bin)) { /* path_rrdtool_bin is a global option */ log_error_write(srv, __FILE__, __LINE__, "s", @@ -382,7 +382,7 @@ SETDEFAULTS_FUNC(mod_rrd_set_defaults) { /* check for dir */ - if (buffer_is_empty(p->conf.path_rrdtool_bin)) { + if (buffer_string_is_empty(p->conf.path_rrdtool_bin)) { log_error_write(srv, __FILE__, __LINE__, "s", "rrdtool.binary has to be set"); return HANDLER_ERROR; @@ -409,7 +409,7 @@ TRIGGER_FUNC(mod_rrd_trigger) { plugin_config *s = p->config_storage[i]; int r; - if (buffer_is_empty(s->path_rrd)) continue; + if (buffer_string_is_empty(s->path_rrd)) continue; /* write the data down every minute */ @@ -418,11 +418,11 @@ TRIGGER_FUNC(mod_rrd_trigger) { buffer_copy_string_len(p->cmd, CONST_STR_LEN("update ")); buffer_append_string_buffer(p->cmd, s->path_rrd); buffer_append_string_len(p->cmd, CONST_STR_LEN(" N:")); - buffer_append_off_t(p->cmd, s->bytes_read); + buffer_append_int(p->cmd, s->bytes_read); buffer_append_string_len(p->cmd, CONST_STR_LEN(":")); - buffer_append_off_t(p->cmd, s->bytes_written); + buffer_append_int(p->cmd, s->bytes_written); buffer_append_string_len(p->cmd, CONST_STR_LEN(":")); - buffer_append_long(p->cmd, s->requests); + buffer_append_int(p->cmd, s->requests); buffer_append_string_len(p->cmd, CONST_STR_LEN("\n")); if (-1 == (r = safe_write(p->write_fd, p->cmd->ptr, p->cmd->used - 1))) { |