Skip to content

Commit

Permalink
Don't try to maximize the send buffer
Browse files Browse the repository at this point in the history
Get rid of code that did a binary search to maximize the send buffer
via setsockopt SO_SNDBUF. It caused problems for modern Mac users.
  • Loading branch information
job committed May 1, 2024
1 parent 9ffc4f8 commit f44bf47
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 132 deletions.
3 changes: 3 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
1.13 (2024-05-01)
- Fixed a bug for Mac users by removing sx_maxsockbuf()

1.12 (2024-02-12)
- Fix a bug in the mikrotik printer

Expand Down
1 change: 0 additions & 1 deletion Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ bgpq4_LDADD += $(top_builddir)/compat/libcompat.la
endif

bgpq4_SOURCES=main.c extern.h printer.c expander.c \
sx_maxsockbuf.c \
sx_prefix.c sx_prefix.h \
sx_report.c sx_report.h \
sx_slentry.c
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.12
1.13
10 changes: 0 additions & 10 deletions expander.c
Original file line number Diff line number Diff line change
Expand Up @@ -1075,16 +1075,6 @@ bgpq_expand(struct bgpq_expander *b)
continue;
}

err = sx_maxsockbuf(fd, SO_SNDBUF);
if (err > 0) {
SX_DEBUG(debug_expander, "Acquired sendbuf of %i "
"bytes\n", err);
} else {
close(fd);
fd = -1;
continue;
}

break;
}

Expand Down
3 changes: 0 additions & 3 deletions extern.h
Original file line number Diff line number Diff line change
Expand Up @@ -149,9 +149,6 @@ void sx_radix_tree_freeall(struct sx_radix_tree *t);
void bgpq_prequest_freeall(struct bgpq_prequest *bpr);
void expander_freeall(struct bgpq_expander *expander);

/* s - number of opened socket, dir is either SO_SNDBUF or SO_RCVBUF */
int sx_maxsockbuf(int s, int dir);

#ifndef HAVE_STRLCPY
size_t strlcpy(char *dst, const char *src, size_t size);
#endif
117 changes: 0 additions & 117 deletions sx_maxsockbuf.c

This file was deleted.

0 comments on commit f44bf47

Please sign in to comment.