diff options
author | Yasuhiro Kimura <yasu@FreeBSD.org> | 2022-07-22 19:02:22 +0000 |
---|---|---|
committer | Yasuhiro Kimura <yasu@FreeBSD.org> | 2022-08-07 05:30:25 +0000 |
commit | 206e447a8330a3dba38f4e4a1210f4f04eb7e783 (patch) | |
tree | 31f4248bc8f4cd526d908182f23fc7ee3bc596fe /sysutils/bsdstats/files | |
parent | a43eddf7cd6d1f1ccf0991dbbff54ec9cc33a44c (diff) | |
download | ports-206e447a8330a3dba38f4e4a1210f4f04eb7e783.tar.gz ports-206e447a8330a3dba38f4e4a1210f4f04eb7e783.zip |
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
Diffstat (limited to 'sysutils/bsdstats/files')
-rw-r--r-- | sysutils/bsdstats/files/300.statistics.in | 2 |
1 files changed, 1 insertions, 1 deletions
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?" |