summaryrefslogtreecommitdiffstats
path: root/unix
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2022-10-27 07:13:44 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2022-10-27 07:13:44 (GMT)
commitdac15673b885ae2bd565897a338f47ed040db3d6 (patch)
treefd80060e72ebe5529caa0cac30b9edf33610cf67 /unix
parentb8b4026cbf7a7e5944ff548b9b678b4c777f6eca (diff)
parent0a6e6c49772e9b3a8dc4af9476faa265301e13ef (diff)
downloadtcl-dac15673b885ae2bd565897a338f47ed040db3d6.zip
tcl-dac15673b885ae2bd565897a338f47ed040db3d6.tar.gz
tcl-dac15673b885ae2bd565897a338f47ed040db3d6.tar.bz2
Merge 8.7
Diffstat (limited to 'unix')
-rw-r--r--unix/tclUnixSock.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/unix/tclUnixSock.c b/unix/tclUnixSock.c
index adcda4f..de4d9a8 100644
--- a/unix/tclUnixSock.c
+++ b/unix/tclUnixSock.c
@@ -1670,6 +1670,7 @@ Tcl_OpenTcpServerEx(
const char *service, /* Port number to open. */
const char *myHost, /* Name of local host. */
unsigned int flags, /* Flags. */
+ int backlog, /* Length of OS listen backlog queue. */
Tcl_TcpAcceptProc *acceptProc,
/* Callback for accepting connections from new
* clients. */
@@ -1835,7 +1836,10 @@ Tcl_OpenTcpServerEx(
chosenport = ntohs(sockname.sa4.sin_port);
}
}
- status = listen(sock, SOMAXCONN);
+ if (backlog < 0) {
+ backlog = SOMAXCONN;
+ }
+ status = listen(sock, backlog);
if (status < 0) {
if (howfar < LISTEN) {
howfar = LISTEN;