Skip to content

Commit

Permalink
Release 1.14
Browse files Browse the repository at this point in the history
  • Loading branch information
job committed May 14, 2024
1 parent a97f7eb commit 4fe2500
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
4 changes: 2 additions & 2 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
1.14
- Set TCP_NODELAY on the whois socket
1.14 (2024-05-14)
- Small performance gain: set TCP_NODELAY on the socket

1.13 (2024-05-01)
- Fixed a bug for Mac users by removing sx_maxsockbuf()
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.13
1.14
10 changes: 9 additions & 1 deletion expander.c
Original file line number Diff line number Diff line change
Expand Up @@ -1035,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, nodelay = 1;
int fd = -1, err, ret, aquery = 0, nodelay = 0;
int slen;

sl.l_onoff = 1;
Expand Down Expand Up @@ -1076,11 +1076,19 @@ bgpq_expand(struct bgpq_expander *b)
continue;
}

socklen_t len = sizeof(nodelay);
getsockopt(fd, IPPROTO_TCP, TCP_NODELAY, &nodelay, &len);
SX_DEBUG(debug_expander, "TCP_NODELAY set to %i\n", nodelay);

nodelay = 0;
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));

getsockopt(fd, IPPROTO_TCP, TCP_NODELAY, &nodelay, &len);
SX_DEBUG(debug_expander, "TCP_NODELAY set to %i\n", nodelay);

break;
}

Expand Down

0 comments on commit 4fe2500

Please sign in to comment.