Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 7 Aug 2022 05:36:50 GMT
From:      Yasuhiro Kimura <yasu@FreeBSD.org>
To:        ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-branches@FreeBSD.org
Subject:   git: 2ec30f23b3bb - 2022Q3 - sysutils/bsdstats: Set timeout to wait response from server
Message-ID:  <202208070536.2775aoWI042120@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch 2022Q3 has been updated by yasu:

URL: https://cgit.FreeBSD.org/ports/commit/?id=2ec30f23b3bb475e3dfd4022c992ab53f2076055

commit 2ec30f23b3bb475e3dfd4022c992ab53f2076055
Author:     Yasuhiro Kimura <yasu@FreeBSD.org>
AuthorDate: 2022-07-22 19:02:22 +0000
Commit:     Yasuhiro Kimura <yasu@FreeBSD.org>
CommitDate: 2022-08-07 05:33:41 +0000

    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
    
    (cherry picked from commit 206e447a8330a3dba38f4e4a1210f4f04eb7e783)
---
 sysutils/bsdstats/Makefile                | 2 +-
 sysutils/bsdstats/files/300.statistics.in | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/sysutils/bsdstats/Makefile b/sysutils/bsdstats/Makefile
index e696ed85b68e..cd38ddc5150f 100644
--- a/sysutils/bsdstats/Makefile
+++ b/sysutils/bsdstats/Makefile
@@ -2,7 +2,7 @@
 
 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?"



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202208070536.2775aoWI042120>