Skip to content

Commit

Permalink
in_syslog: renamed option buffer_rcv_size to receive_buffer_size
Browse files Browse the repository at this point in the history
Signed-off-by: Benoît GARNIER <[email protected]>
  • Loading branch information
ChezBunch authored and edsiper committed Nov 8, 2022
1 parent f2c73ca commit 58a4fc2
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
4 changes: 2 additions & 2 deletions plugins/in_syslog/syslog.c
Original file line number Diff line number Diff line change
Expand Up @@ -228,8 +228,8 @@ static struct flb_config_map config_map[] = {
"Set the parser"
},
{
FLB_CONFIG_MAP_SIZE, "buffer_rcv_size", (char *)NULL,
0, FLB_TRUE, offsetof(struct flb_syslog, buffer_rcv_size),
FLB_CONFIG_MAP_SIZE, "receive_buffer_size", (char *)NULL,
0, FLB_TRUE, offsetof(struct flb_syslog, receive_buffer_size),
"Set the socket receiving buffer size"
},
/* EOF */
Expand Down
2 changes: 1 addition & 1 deletion plugins/in_syslog/syslog.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ struct flb_syslog {
flb_sds_t unix_path;
flb_sds_t unix_perm_str;
unsigned int unix_perm;
size_t buffer_rcv_size;
size_t receive_buffer_size;

/* UDP buffer, data length and buffer size */
// char *buffer_data;
Expand Down
4 changes: 2 additions & 2 deletions plugins/in_syslog/syslog_conf.c
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,8 @@ struct flb_syslog *syslog_conf_create(struct flb_input_instance *ins,
}

/* Socket rcv buffer size */
if (ctx->buffer_rcv_size == -1 || ctx->buffer_rcv_size>INT_MAX) {
flb_plg_error(ins, "invalid buffer_rcv_size");
if (ctx->receive_buffer_size == -1 || ctx->receive_buffer_size>INT_MAX) {
flb_plg_error(ins, "invalid receive_buffer_size");
flb_free(ctx);
return NULL;
}
Expand Down
7 changes: 4 additions & 3 deletions plugins/in_syslog/syslog_server.c
Original file line number Diff line number Diff line change
Expand Up @@ -166,10 +166,11 @@ static int syslog_server_net_create(struct flb_syslog *ctx)
return -1;
}

if (ctx->buffer_rcv_size) {
if (flb_net_socket_rcv_buffer(ctx->downstream->server_fd, ctx->buffer_rcv_size)) {
if (ctx->receive_buffer_size) {
if (flb_net_socket_rcv_buffer(ctx->downstream->server_fd,
ctx->receive_buffer_size)) {
flb_error("[in_syslog] could not set rcv buffer to %ld. Aborting",
ctx->buffer_rcv_size);
ctx->receive_buffer_size);
return -1;
}
}
Expand Down

0 comments on commit 58a4fc2

Please sign in to comment.