head 1.2; access; symbols pkgsrc-2013Q2:1.2.0.54 pkgsrc-2013Q2-base:1.2 pkgsrc-2012Q4:1.2.0.52 pkgsrc-2012Q4-base:1.2 pkgsrc-2011Q4:1.2.0.50 pkgsrc-2011Q4-base:1.2 pkgsrc-2011Q2:1.2.0.48 pkgsrc-2011Q2-base:1.2 pkgsrc-2009Q4:1.2.0.46 pkgsrc-2009Q4-base:1.2 pkgsrc-2008Q4:1.2.0.44 pkgsrc-2008Q4-base:1.2 pkgsrc-2008Q3:1.2.0.42 pkgsrc-2008Q3-base:1.2 cube-native-xorg:1.2.0.40 cube-native-xorg-base:1.2 pkgsrc-2008Q2:1.2.0.38 pkgsrc-2008Q2-base:1.2 pkgsrc-2008Q1:1.2.0.36 pkgsrc-2008Q1-base:1.2 pkgsrc-2007Q4:1.2.0.34 pkgsrc-2007Q4-base:1.2 pkgsrc-2007Q3:1.2.0.32 pkgsrc-2007Q3-base:1.2 pkgsrc-2007Q2:1.2.0.30 pkgsrc-2007Q2-base:1.2 pkgsrc-2007Q1:1.2.0.28 pkgsrc-2007Q1-base:1.2 pkgsrc-2006Q4:1.2.0.26 pkgsrc-2006Q4-base:1.2 pkgsrc-2006Q3:1.2.0.24 pkgsrc-2006Q3-base:1.2 pkgsrc-2006Q2:1.2.0.22 pkgsrc-2006Q2-base:1.2 pkgsrc-2006Q1:1.2.0.20 pkgsrc-2006Q1-base:1.2 pkgsrc-2005Q4:1.2.0.18 pkgsrc-2005Q4-base:1.2 pkgsrc-2005Q3:1.2.0.16 pkgsrc-2005Q3-base:1.2 pkgsrc-2005Q2:1.2.0.14 pkgsrc-2005Q2-base:1.2 pkgsrc-2005Q1:1.2.0.12 pkgsrc-2005Q1-base:1.2 pkgsrc-2004Q4:1.2.0.10 pkgsrc-2004Q4-base:1.2 pkgsrc-2004Q3:1.2.0.8 pkgsrc-2004Q3-base:1.2 pkgsrc-2004Q2:1.2.0.6 pkgsrc-2004Q2-base:1.2 pkgsrc-2004Q1:1.2.0.4 pkgsrc-2004Q1-base:1.2 pkgsrc-2003Q4:1.2.0.2 pkgsrc-2003Q4-base:1.2 buildlink2-base:1.2 netbsd-1-4-RELEASE:1.1; locks; strict; comment @# @; 1.2 date 99.06.04.23.45.43; author rvb; state dead; branches; next 1.1; 1.1 date 99.04.28.23.56.34; author rvb; state Exp; branches; next ; desc @@ 1.2 log @Sync with 5.2.4 @ text @$NetBSD: patch-df,v 1.1 1999/04/28 23:56:34 rvb Exp $ diff -u /usr/pkgsrc/net/coda-5.2.2/coda-src/venus/comm.cc ./coda-src/venus/comm.cc --- /usr/pkgsrc/net/coda-5.2.2/coda-src/venus/comm.cc Mon Apr 19 20:02:53 1999 +++ ./coda-src/venus/comm.cc Wed Apr 28 13:01:26 1999 @@@@ -172,13 +172,6 @@@@ if (gethostname(myHostName, MAXHOSTNAMELEN) < 0) CHOKE("CommInit: gethostname failed"); - /* Hostid is needed for storeid generation. */ -#ifdef DJGPP - myHostId = __djgpp_get_my_host(); /* this needs MYHOST in the cwd */ -#else - myHostId = gethostid(); -#endif - /* Initialize Connections. */ connent::conntab = new olist; @@@@ -1074,6 +1067,7 @@@@ probeme = 0; EventCounter = 0; userbw = 0; + isweak = 0; bw = INIT_BW; bwvar = 0; timerclear(&lastobs); @@@@ -1353,6 +1347,7 @@@@ long srvent::GetBandwidth(unsigned long *Bandwidth) { long rc = 0; unsigned long oldbw = bw; + unsigned long bwmin, bwmax; LOG(1, ("srvent::GetBandwidth (%s) lastobs %ld.%06ld\n", name, lastobs.tv_sec, lastobs.tv_usec)); @@@@ -1371,9 +1366,9 @@@@ } /* retrieve the bandwidth information from RPC2 */ - if ((rc = RPC2_GetBandwidth(connid, &bw, &bwvar)) != RPC2_SUCCESS) + if ((rc = RPC2_GetBandwidth(connid, &bwmin, &bw, &bwmax)) != RPC2_SUCCESS) return(rc); - + LOG(1, ("srvent:GetBandWidth: --> new BW %d bytes/sec\n", bw)); /* update last observation time */ @@@@ -1383,20 +1378,22 @@@@ * Signal if we've crossed the weakly-connected threshold. Note * that the connection is considered strong until proven otherwise. */ - if (oldbw > WCThresh && bw <= WCThresh) { + if (!isweak && bwmax < WCThresh) { + isweak = 1; MarinerLog("connection::weak %s\n", name); VSGDB->WeakEvent(host); NotifyUsersOfServerWeakEvent(name); } - else if (oldbw <= WCThresh && bw > WCThresh) { + else if (isweak && bwmin > WCThresh) { + isweak = 0; MarinerLog("connection::strong %s\n", name); VSGDB->StrongEvent(host); NotifyUsersOfServerStrongEvent(name); } *Bandwidth = bw; + MarinerLog("connection::bandwidth %s %d %d %d\n", name,bwmin,bw,bwmax); if (bw != oldbw) { - MarinerLog("connection::bandwidth %s %d\n", name, bw); NotifyUsersOfServerBandwidthEvent(name,*Bandwidth); } LOG(1, ("srvent::GetBandwidth (%s) returns %d bytes/sec\n", @@@@ -1430,12 +1427,14 @@@@ */ bw = userbw ? b : INIT_BW; bwvar = 0; - if (oldbw > WCThresh && bw <= WCThresh) { + if (!isweak && bw <= WCThresh) { + isweak = 1; MarinerLog("connection::weak %s\n", name); VSGDB->WeakEvent(host); NotifyUsersOfServerWeakEvent(name); } - else if (oldbw <= WCThresh && bw > WCThresh) { + else if (isweak && bw > WCThresh) { + isweak = 0; MarinerLog("connection::strong %s\n", name); VSGDB->StrongEvent(host); NotifyUsersOfServerStrongEvent(name); @ 1.1 log @stabilize bandwidth calculation @ text @d1 1 a1 1 $NetBSD$ @