=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/ssh/misc.c,v retrieving revision 1.134 retrieving revision 1.135 diff -u -r1.134 -r1.135 --- src/usr.bin/ssh/misc.c 2018/11/16 03:26:01 1.134 +++ src/usr.bin/ssh/misc.c 2018/12/07 04:36:09 1.135 @@ -1,4 +1,4 @@ -/* $OpenBSD: misc.c,v 1.134 2018/11/16 03:26:01 djm Exp $ */ +/* $OpenBSD: misc.c,v 1.135 2018/12/07 04:36:09 dtucker Exp $ */ /* * Copyright (c) 2000 Markus Friedl. All rights reserved. * Copyright (c) 2005,2006 Damien Miller. All rights reserved. @@ -1271,11 +1271,11 @@ { bw->buflen = buflen; bw->rate = kbps; - bw->thresh = bw->rate; + bw->thresh = buflen; bw->lamt = 0; timerclear(&bw->bwstart); timerclear(&bw->bwend); -} +} /* Callback from read/write loop to insert bandwidth-limiting delays */ void @@ -1284,12 +1284,11 @@ u_int64_t waitlen; struct timespec ts, rm; + bw->lamt += read_len; if (!timerisset(&bw->bwstart)) { monotime_tv(&bw->bwstart); return; } - - bw->lamt += read_len; if (bw->lamt < bw->thresh) return;