|
@@ -83,6 +83,7 @@ struct {
|
|
|
int num_listen_addrs;
|
|
int num_listen_addrs;
|
|
|
char *comm_predicate;
|
|
char *comm_predicate;
|
|
|
char *relay_predicate;
|
|
char *relay_predicate;
|
|
|
|
|
+ int client_sndbuf;
|
|
|
} options;
|
|
} options;
|
|
|
|
|
|
|
|
// listen addresses
|
|
// listen addresses
|
|
@@ -572,6 +573,7 @@ void print_help (const char *name)
|
|
|
" [--ssl --nssdb <string> --server-cert-name <string>]\n"
|
|
" [--ssl --nssdb <string> --server-cert-name <string>]\n"
|
|
|
" [--comm-predicate <string>]\n"
|
|
" [--comm-predicate <string>]\n"
|
|
|
" [--relay-predicate <string>]\n"
|
|
" [--relay-predicate <string>]\n"
|
|
|
|
|
+ " [--client-sndbuf <bytes / 0>]\n"
|
|
|
"Address format is a.b.c.d:port (IPv4) or [addr]:port (IPv6).\n",
|
|
"Address format is a.b.c.d:port (IPv4) or [addr]:port (IPv6).\n",
|
|
|
name
|
|
name
|
|
|
);
|
|
);
|
|
@@ -601,6 +603,7 @@ int parse_arguments (int argc, char *argv[])
|
|
|
options.num_listen_addrs = 0;
|
|
options.num_listen_addrs = 0;
|
|
|
options.comm_predicate = NULL;
|
|
options.comm_predicate = NULL;
|
|
|
options.relay_predicate = NULL;
|
|
options.relay_predicate = NULL;
|
|
|
|
|
+ options.client_sndbuf = CLIENT_SOCKET_DEFAULT_SEND_BUFFER;
|
|
|
|
|
|
|
|
for (int i = 1; i < argc; i++) {
|
|
for (int i = 1; i < argc; i++) {
|
|
|
char *arg = argv[i];
|
|
char *arg = argv[i];
|
|
@@ -725,6 +728,17 @@ int parse_arguments (int argc, char *argv[])
|
|
|
options.relay_predicate = argv[i + 1];
|
|
options.relay_predicate = argv[i + 1];
|
|
|
i++;
|
|
i++;
|
|
|
}
|
|
}
|
|
|
|
|
+ else if (!strcmp(arg, "--client-sndbuf")) {
|
|
|
|
|
+ if (1 >= argc - i) {
|
|
|
|
|
+ fprintf(stderr, "%s: requires an argument\n", arg);
|
|
|
|
|
+ return 0;
|
|
|
|
|
+ }
|
|
|
|
|
+ if ((options.client_sndbuf = atoi(argv[i + 1])) < 0) {
|
|
|
|
|
+ fprintf(stderr, "%s: wrong argument\n", arg);
|
|
|
|
|
+ return 0;
|
|
|
|
|
+ }
|
|
|
|
|
+ i++;
|
|
|
|
|
+ }
|
|
|
else {
|
|
else {
|
|
|
fprintf(stderr, "%s: unknown option\n", arg);
|
|
fprintf(stderr, "%s: unknown option\n", arg);
|
|
|
return 0;
|
|
return 0;
|
|
@@ -792,7 +806,7 @@ void listener_handler (BListener *listener)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// limit socket send buffer, else our scheduling is pointless
|
|
// limit socket send buffer, else our scheduling is pointless
|
|
|
- if (!BConnection_SetSendBuffer(&client->con, CLIENT_SOCKET_SEND_BUFFER) < 0) {
|
|
|
|
|
|
|
+ if (!BConnection_SetSendBuffer(&client->con, options.client_sndbuf) < 0) {
|
|
|
BLog(BLOG_WARNING, "BConnection_SetSendBuffer failed");
|
|
BLog(BLOG_WARNING, "BConnection_SetSendBuffer failed");
|
|
|
}
|
|
}
|
|
|
|
|
|