mirror of
https://github.com/bgp/bgpq4.git
synced 2024-05-11 05:55:05 +00:00
Set TCP_NODELAY on the socket
Nagle's algorithm probably serves no purpose with whois queries often being tiny.
This commit is contained in:
3
CHANGES
3
CHANGES
@ -1,3 +1,6 @@
|
||||
1.14
|
||||
- Set TCP_NODELAY on the whois socket
|
||||
|
||||
1.13 (2024-05-01)
|
||||
- Fixed a bug for Mac users by removing sx_maxsockbuf()
|
||||
|
||||
|
@ -36,8 +36,8 @@ maintainer-clean-local:
|
||||
check:
|
||||
./bgpq4 -v
|
||||
@echo
|
||||
-@if [ -s /etc/resolv.conf ]; then \
|
||||
./bgpq4 -6 AS15562:AS-SNIJDERS | grep 2001:67c:208c::; \
|
||||
-if [ -s /etc/resolv.conf ]; then \
|
||||
./bgpq4 -ddd -6 AS15562:AS-SNIJDERS ; \
|
||||
else \
|
||||
echo "No or empty /etc/resolv.conf, skipping online test"; \
|
||||
fi
|
||||
|
@ -29,6 +29,7 @@
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/select.h>
|
||||
#include <netinet/tcp.h>
|
||||
|
||||
#include <assert.h>
|
||||
#include <ctype.h>
|
||||
@ -1034,7 +1035,7 @@ bgpq_expand(struct bgpq_expander *b)
|
||||
struct addrinfo hints, *res = NULL, *rp;
|
||||
struct linger sl;
|
||||
struct asn_entry *asne;
|
||||
int fd = -1, err, ret, aquery = 0;
|
||||
int fd = -1, err, ret, aquery = 0, nodelay = 1;
|
||||
int slen;
|
||||
|
||||
sl.l_onoff = 1;
|
||||
@ -1075,6 +1076,11 @@ bgpq_expand(struct bgpq_expander *b)
|
||||
continue;
|
||||
}
|
||||
|
||||
if (setsockopt(fd, IPPROTO_TCP, TCP_NODELAY, &nodelay,
|
||||
sizeof(nodelay)) == -1)
|
||||
SX_DEBUG(debug_expander, "Unable to set TCP_NODELAY on"
|
||||
" socket: %s\n", strerror(errno));
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user