upstream: Fix calculation of initial bandwidth limits. Account for

written bytes before the initial timer check so that the first buffer written
is accounted.  Set the threshold after which the timer is checked such that
the limit starts being computed as soon as possible, ie after the second
buffer is written.  This prevents an initial burst of traffic and provides a
more accurate bandwidth limit.  bz#2927, ok djm.

OpenBSD-Commit-ID: ff3ef76e4e43040ec198c2718d5682c36b255cb6
2 files changed
tree: 2aee75c1f39344d80af0772aa4dacf6885e827f5
  1. contrib/
  2. openbsd-compat/
  3. regress/
  4. .depend
  5. .gitignore
  6. .skipped-commit-ids
  7. aclocal.m4
  8. addrmatch.c
  9. atomicio.c
  10. atomicio.h
  11. audit-bsm.c
  12. audit-linux.c
  13. audit.c
  14. audit.h
  15. auth-bsdauth.c
  16. auth-krb5.c
  17. auth-options.c
  18. auth-options.h
  19. auth-pam.c
  20. auth-pam.h
  21. auth-passwd.c
  22. auth-rhosts.c
  23. auth-shadow.c
  24. auth-sia.c
  25. auth-sia.h
  26. auth-skey.c
  27. auth.c
  28. auth.h
  29. auth2-chall.c
  30. auth2-gss.c
  31. auth2-hostbased.c
  32. auth2-kbdint.c
  33. auth2-none.c
  34. auth2-passwd.c
  35. auth2-pubkey.c
  36. auth2.c
  37. authfd.c
  38. authfd.h
  39. authfile.c
  40. authfile.h
  41. bitmap.c
  42. bitmap.h
  43. buildpkg.sh.in
  44. canohost.c
  45. canohost.h
  46. chacha.c
  47. chacha.h
  48. channels.c
  49. channels.h
  50. cipher-aes.c
  51. cipher-aesctr.c
  52. cipher-aesctr.h
  53. cipher-chachapoly.c
  54. cipher-chachapoly.h
  55. cipher-ctr.c
  56. cipher.c
  57. cipher.h
  58. cleanup.c
  59. clientloop.c
  60. clientloop.h
  61. compat.c
  62. compat.h
  63. config.guess
  64. config.sub
  65. configure.ac
  66. crc32.c
  67. crc32.h
  68. CREDITS
  69. crypto_api.h
  70. defines.h
  71. dh.c
  72. dh.h
  73. digest-libc.c
  74. digest-openssl.c
  75. digest.h
  76. dispatch.c
  77. dispatch.h
  78. dns.c
  79. dns.h
  80. ed25519.c
  81. entropy.c
  82. entropy.h
  83. fatal.c
  84. fe25519.c
  85. fe25519.h
  86. fixalgorithms
  87. fixpaths
  88. ge25519.c
  89. ge25519.h
  90. ge25519_base.data
  91. groupaccess.c
  92. groupaccess.h
  93. gss-genr.c
  94. gss-serv-krb5.c
  95. gss-serv.c
  96. hash.c
  97. hmac.c
  98. hmac.h
  99. hostfile.c
  100. hostfile.h
  101. includes.h
  102. INSTALL
  103. install-sh
  104. kex.c
  105. kex.h
  106. kexc25519.c
  107. kexc25519c.c
  108. kexc25519s.c
  109. kexdh.c
  110. kexdhc.c
  111. kexdhs.c
  112. kexecdh.c
  113. kexecdhc.c
  114. kexecdhs.c
  115. kexgex.c
  116. kexgexc.c
  117. kexgexs.c
  118. krl.c
  119. krl.h
  120. LICENCE
  121. log.c
  122. log.h
  123. loginrec.c
  124. loginrec.h
  125. logintest.c
  126. mac.c
  127. mac.h
  128. Makefile.in
  129. match.c
  130. match.h
  131. md5crypt.c
  132. md5crypt.h
  133. mdoc2man.awk
  134. misc.c
  135. misc.h
  136. mkinstalldirs
  137. moduli
  138. moduli.5
  139. moduli.c
  140. monitor.c
  141. monitor.h
  142. monitor_fdpass.c
  143. monitor_fdpass.h
  144. monitor_wrap.c
  145. monitor_wrap.h
  146. msg.c
  147. msg.h
  148. mux.c
  149. myproposal.h
  150. nchan.c
  151. nchan.ms
  152. nchan2.ms
  153. opacket.c
  154. opacket.h
  155. openssh.xml.in
  156. opensshd.init.in
  157. OVERVIEW
  158. packet.c
  159. packet.h
  160. pathnames.h
  161. pkcs11.h
  162. platform-misc.c
  163. platform-pledge.c
  164. platform-tracing.c
  165. platform.c
  166. platform.h
  167. poly1305.c
  168. poly1305.h
  169. progressmeter.c
  170. progressmeter.h
  171. PROTOCOL
  172. PROTOCOL.agent
  173. PROTOCOL.certkeys
  174. PROTOCOL.chacha20poly1305
  175. PROTOCOL.key
  176. PROTOCOL.krl
  177. PROTOCOL.mux
  178. readconf.c
  179. readconf.h
  180. README
  181. README.dns
  182. README.platform
  183. README.privsep
  184. README.tun
  185. readpass.c
  186. rijndael.c
  187. rijndael.h
  188. sandbox-capsicum.c
  189. sandbox-darwin.c
  190. sandbox-null.c
  191. sandbox-pledge.c
  192. sandbox-rlimit.c
  193. sandbox-seccomp-filter.c
  194. sandbox-solaris.c
  195. sandbox-systrace.c
  196. sc25519.c
  197. sc25519.h
  198. scp.1
  199. scp.c
  200. servconf.c
  201. servconf.h
  202. serverloop.c
  203. serverloop.h
  204. session.c
  205. session.h
  206. sftp-client.c
  207. sftp-client.h
  208. sftp-common.c
  209. sftp-common.h
  210. sftp-glob.c
  211. sftp-server-main.c
  212. sftp-server.8
  213. sftp-server.c
  214. sftp.1
  215. sftp.c
  216. sftp.h
  217. smult_curve25519_ref.c
  218. ssh-add.1
  219. ssh-add.c
  220. ssh-agent.1
  221. ssh-agent.c
  222. ssh-dss.c
  223. ssh-ecdsa.c
  224. ssh-ed25519.c
  225. ssh-gss.h
  226. ssh-keygen.1
  227. ssh-keygen.c
  228. ssh-keyscan.1
  229. ssh-keyscan.c
  230. ssh-keysign.8
  231. ssh-keysign.c
  232. ssh-pkcs11-client.c
  233. ssh-pkcs11-helper.8
  234. ssh-pkcs11-helper.c
  235. ssh-pkcs11.c
  236. ssh-pkcs11.h
  237. ssh-rsa.c
  238. ssh-sandbox.h
  239. ssh-xmss.c
  240. ssh.1
  241. ssh.c
  242. ssh.h
  243. ssh2.h
  244. ssh_api.c
  245. ssh_api.h
  246. ssh_config
  247. ssh_config.5
  248. sshbuf-getput-basic.c
  249. sshbuf-getput-crypto.c
  250. sshbuf-misc.c
  251. sshbuf.c
  252. sshbuf.h
  253. sshconnect.c
  254. sshconnect.h
  255. sshconnect2.c
  256. sshd.8
  257. sshd.c
  258. sshd_config
  259. sshd_config.5
  260. ssherr.c
  261. ssherr.h
  262. sshkey-xmss.c
  263. sshkey-xmss.h
  264. sshkey.c
  265. sshkey.h
  266. sshlogin.c
  267. sshlogin.h
  268. sshpty.c
  269. sshpty.h
  270. sshtty.c
  271. survey.sh.in
  272. TODO
  273. ttymodes.c
  274. ttymodes.h
  275. uidswap.c
  276. uidswap.h
  277. umac.c
  278. umac.h
  279. umac128.c
  280. utf8.c
  281. utf8.h
  282. uuencode.c
  283. uuencode.h
  284. verify.c
  285. version.h
  286. xmalloc.c
  287. xmalloc.h
  288. xmss_commons.c
  289. xmss_commons.h
  290. xmss_fast.c
  291. xmss_fast.h
  292. xmss_hash.c
  293. xmss_hash.h
  294. xmss_hash_address.c
  295. xmss_hash_address.h
  296. xmss_wots.c
  297. xmss_wots.h