summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 1cee13d)
raw | patch | inline | side by side (parent: 1cee13d)
author | Florian Forster <octo@collectd.org> | |
Tue, 2 May 2017 09:08:37 +0000 (11:08 +0200) | ||
committer | Florian Forster <octo@collectd.org> | |
Tue, 2 May 2017 09:08:37 +0000 (11:08 +0200) |
src/libcollectdclient/collectd/server.h | patch | blob | history | |
src/libcollectdclient/server.c | patch | blob | history |
index d19021734d30e364cd3098d1cc66aebc96d61f7d..38bc68f7340332efc8bda154f52767482370d053 100644 (file)
#include <stdint.h>
+#ifndef LCC_NETWORK_BUFFER_SIZE
+#define LCC_NETWORK_BUFFER_SIZE 1452
+#endif
+
LCC_BEGIN_DECLS
/* lcc_network_parser_t is a callback that parses received network packets. It
/* parse_options contains options for parser and is passed on verbatimely. */
lcc_network_parse_options_t parse_options;
- /* buffer_size determines the maximum packet size to accept. */
+ /* buffer_size determines the maximum packet size to accept. Defaults to
+ * LCC_NETWORK_BUFFER_SIZE if set to zero. */
uint16_t buffer_size;
/* interface is the name of the interface to use when subscribing to a
index 1c4a1013726743e228d7394bfd6732c37282a093..50f6be1dfec169f4aa8e7f293db94d49f6d1fd96 100644 (file)
}
if (srv.buffer_size == 0)
- /* TODO(octo): this should be a define. */
- srv.buffer_size = 1452;
+ srv.buffer_size = LCC_NETWORK_BUFFER_SIZE;
if (srv.parser == NULL)
srv.parser = lcc_network_parse;