counter parts, as well as "tune.sndbuf.backend" and "tune.sndbuf.frontend"
for the send setting.
-tune.rcvbuf.client <number>
-tune.rcvbuf.server <number>
+tune.rcvbuf.client <size>
+tune.rcvbuf.server <size>
Forces the kernel socket receive buffer size on the client or the server side
to the specified value in bytes. This value applies to all TCP/HTTP frontends
and backends. It should normally never be set, and the default size (0) lets
"tune.sndbuf.server" for their connected socket counter parts, as well as
"tune.rcvbuf.backend" and "tune.rcvbuf.frontend" for the receive setting.
-tune.sndbuf.client <number>
-tune.sndbuf.server <number>
+tune.sndbuf.client <size>
+tune.sndbuf.server <size>
Forces the kernel socket send buffer size on the client or the server side to
the specified value in bytes. This value applies to all TCP/HTTP frontends
and backends. It should normally never be set, and the default size (0) lets
int maxrewrite; /* buffer max rewrite size in bytes, defaults to MAXREWRITE */
int reserved_bufs; /* how many buffers can only be allocated for response */
int buf_limit; /* if not null, how many total buffers may only be allocated */
- int client_sndbuf; /* set client sndbuf to this value if not null */
- int client_rcvbuf; /* set client rcvbuf to this value if not null */
- int server_sndbuf; /* set server sndbuf to this value if not null */
- int server_rcvbuf; /* set server rcvbuf to this value if not null */
+ uint client_sndbuf; /* set client sndbuf to this value if not null */
+ uint client_rcvbuf; /* set client rcvbuf to this value if not null */
+ uint server_sndbuf; /* set server sndbuf to this value if not null */
+ uint server_rcvbuf; /* set server rcvbuf to this value if not null */
int frontend_sndbuf; /* set frontend dgram sndbuf to this value if not null */
int frontend_rcvbuf; /* set frontend dgram rcvbuf to this value if not null */
int backend_sndbuf; /* set backend dgram sndbuf to this value if not null */
struct proxy *curpx, const struct proxy *defpx,
const char *file, int line, char **err)
{
+ const char *res;
if (too_many_args(1, args, err, NULL))
return -1;
}
else if (strcmp(args[0], "tune.idletimer") == 0) {
unsigned int idle;
- const char *res;
-
if (*(args[1]) == 0) {
memprintf(err, "'%s' expects a timer value between 0 and 65535 ms.", args[0]);
memprintf(err, "'%s' expects an integer argument.", args[0]);
return -1;
}
- global.tune.client_rcvbuf = atol(args[1]);
+ res = parse_size_err(args[1], &global.tune.client_rcvbuf);
+ if (res != NULL)
+ goto size_err;
return 0;
}
memprintf(err, "'%s' expects an integer argument.", args[0]);
return -1;
}
- global.tune.server_rcvbuf = atol(args[1]);
+ res = parse_size_err(args[1], &global.tune.server_rcvbuf);
+ if (res != NULL)
+ goto size_err;
return 0;
}
memprintf(err, "'%s' expects an integer argument.", args[0]);
return -1;
}
- global.tune.client_sndbuf = atol(args[1]);
+ res = parse_size_err(args[1], &global.tune.client_sndbuf);
+ if (res != NULL)
+ goto size_err;
return 0;
}
memprintf(err, "'%s' expects an integer argument.", args[0]);
return -1;
}
- global.tune.server_sndbuf = atol(args[1]);
+ res = parse_size_err(args[1], &global.tune.server_sndbuf);
+ if (res != NULL)
+ goto size_err;
return 0;
}
}
return 0;
+
+ size_err:
+ memprintf(err, "unexpected '%s' after size passed to '%s'", res, args[0]);
+ return -1;
+
}
static int cfg_parse_global_tune_forward_opts(char **args, int section_type,