Commit 1c33669e authored by Mark Andrews's avatar Mark Andrews

increase socket buffers

parent 0aa75d1f
Pipeline #14261 passed with stages
in 1 minute and 15 seconds
......@@ -1453,14 +1453,16 @@ resend(struct workitem *item) {
if (!item->outstanding++)
outstanding++;
gettimeofday(&item->when, NULL);
item->when.tv_sec += 1;
item->when.tv_sec += item->type ? (item->sends ? 1 : 2) : 1;
item->sends++;
if (LINKED(item, link))
UNLINK(work, item, link);
APPEND(work, item, link);
} else if (item->summary->type) {
perror("resend: sendto");
nextserver(item);
} else {
perror("resend: sendto");
addtag(item, "failed");
item->summary->allok = 0;
item->summary->seenfailure = 1;
......@@ -1538,6 +1540,7 @@ send_icmp4(struct workitem *item) {
(struct sockaddr *)&item->summary->storage,
sizeof(struct sockaddr_in));
if (n < 0) {
perror("send_icmp4: sendto");
addtag(item, "skipped");
freeitem(item);
}
......@@ -1879,6 +1882,7 @@ dotest(struct workitem *item, int usec) {
APPEND(work, item, link);
APPEND(ids[item->id], item, idlink);
} else {
perror("dotest: sendto");
error:
if (hmctx != NULL)
HMAC_CTX_free(hmctx);
......@@ -2140,8 +2144,10 @@ dolookup(struct workitem *item, int type) {
item->sends++;
APPEND(work, item, link);
APPEND(ids[item->id], item, idlink);
} else
} else {
perror("dolookup: sendto");
nextserver(item);
}
}
/*
......@@ -4121,6 +4127,22 @@ main(int argc, char **argv) {
udp4 = -1;
}
}
if (udp4 >= 0) {
int rcvbuf = 32*1024*1024;
while (rcvbuf > 0 &&
setsockopt(udp4, SOL_SOCKET, SO_RCVBUF, (void *)&rcvbuf,
sizeof(rcvbuf)) == -1) {
rcvbuf -= 1*1024*1024;
}
}
if (udp4 >= 0) {
int sndbuf = 16*1024*1024;
while (sndbuf > 0 &&
setsockopt(udp4, SOL_SOCKET, SO_SNDBUF, (void *)&sndbuf,
sizeof(sndbuf)) == -1) {
sndbuf -= 1*1024*1024;
}
}
if (udp4 >= 0) {
FD_SET(udp4, &rfds);
if (udp4 > maxfd)
......@@ -4144,6 +4166,22 @@ main(int argc, char **argv) {
udp6 = -1;
}
}
if (udp4 >= 0) {
int rcvbuf = 32*1024*1024;
while (rcvbuf > 0 &&
setsockopt(udp6, SOL_SOCKET, SO_RCVBUF, (void *)&rcvbuf,
sizeof(rcvbuf)) == -1) {
rcvbuf -= 1*1024*1024;
}
}
if (udp4 >= 0) {
int sndbuf = 16*1024*1024;
while (sndbuf > 0 &&
setsockopt(udp6, SOL_SOCKET, SO_SNDBUF, (void *)&sndbuf,
sizeof(sndbuf)) == -1) {
sndbuf -= 1*1024*1024;
}
}
if (udp6 >= 0) {
FD_SET(udp6, &rfds);
if (udp6 > maxfd)
......@@ -4301,7 +4339,7 @@ main(int argc, char **argv) {
(item->when.tv_sec == now.tv_sec &&
item->when.tv_usec > now.tv_usec))
break;
if (item->sends < 3) {
if (item->sends < (item->type ? 5 : 3)) {
resend(item);
} else if (item->type) {
nextserver(item);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment