summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYasuhiro Kimura <yasu@FreeBSD.org>2022-07-23 04:02:22 +0900
committerYasuhiro Kimura <yasu@FreeBSD.org>2022-08-07 14:30:25 +0900
commit206e447a8330a3dba38f4e4a1210f4f04eb7e783 (patch)
tree31f4248bc8f4cd526d908182f23fc7ee3bc596fe
parentscience/pnetcdf: fix build on non amd64 / i386 architectures (diff)
sysutils/bsdstats: Set timeout to wait response from server
Currently 300.statistics hangs up if server accepts connection but doesn't respond to the request. So set timeout to wait response from server. PR: 265389 Approved by: maintainer timeout MFH: 2022Q3
-rw-r--r--sysutils/bsdstats/Makefile2
-rw-r--r--sysutils/bsdstats/files/300.statistics.in2
2 files changed, 2 insertions, 2 deletions
diff --git a/sysutils/bsdstats/Makefile b/sysutils/bsdstats/Makefile
index 6935afad167e..3a64e8fd4a1a 100644
--- a/sysutils/bsdstats/Makefile
+++ b/sysutils/bsdstats/Makefile
@@ -1,6 +1,6 @@
PORTNAME= bsdstats
PORTVERSION= 7.0
-PORTREVISION= 2
+PORTREVISION= 3
CATEGORIES= sysutils
DISTFILES=
diff --git a/sysutils/bsdstats/files/300.statistics.in b/sysutils/bsdstats/files/300.statistics.in
index 0985059d5555..e23df42fb224 100644
--- a/sysutils/bsdstats/files/300.statistics.in
+++ b/sysutils/bsdstats/files/300.statistics.in
@@ -151,7 +151,7 @@ do_http_request() {
if [ -n "${body}" ]; then txt="${txt}${CR}${NL}Content-Length: ${#body}"; fi
txt="${txt}${CR}${NL}${CR}${NL}${body}"
- resp=$(echo "${txt}" | nlog "out" | ${NC} ${nc_host} ${nc_port} | nlog "in" 2>/dev/null)
+ resp=$(echo "${txt}" | nlog "out" | ${NC} -w ${timeout} ${nc_host} ${nc_port} | nlog "in" 2>/dev/null)
if [ $? -ne 0 ]; then
if [ ${do_log} -ne 0 ]; then
log "FAIL" "Failed to send data to the host ${nc_host}:${nc_port}, is network or host down?"