aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2018-06-25 17:13:12 +0200
committerSverker Eriksson <[email protected]>2018-06-28 16:59:18 +0200
commit366fe98c3f685595c5b4e9c6cb19d1034d7b24f6 (patch)
treef68516b35996a15e24d1d12e0c7c05e7d5dc826b /lib
parent5cc7a2d51bf0e0c928d94114bbebf85d7d57a9e0 (diff)
downloadotp-366fe98c3f685595c5b4e9c6cb19d1034d7b24f6.tar.gz
otp-366fe98c3f685595c5b4e9c6cb19d1034d7b24f6.tar.bz2
otp-366fe98c3f685595c5b4e9c6cb19d1034d7b24f6.zip
kernel: Fix tick count bug when pending writes
Diffstat (limited to 'lib')
-rw-r--r--lib/kernel/src/dist_util.erl13
1 files changed, 7 insertions, 6 deletions
diff --git a/lib/kernel/src/dist_util.erl b/lib/kernel/src/dist_util.erl
index 86120a5483..d80971f414 100644
--- a/lib/kernel/src/dist_util.erl
+++ b/lib/kernel/src/dist_util.erl
@@ -750,12 +750,12 @@ send_tick(Socket, Tick, Type, MFTick, MFGetstat) ->
{ok, Tick#tick{write = W + 1,
tick = T1}};
{ok, Read, Write, Pend} ->
- send_tick(Socket, Pend, MFTick),
- {ok, Tick#tick{write = Write + 1,
+ Sent = send_tick(Socket, Pend, MFTick),
+ {ok, Tick#tick{write = Write + Sent,
tick = T1}};
{ok, R, Write, Pend} ->
- send_tick(Socket, Pend, MFTick),
- {ok, Tick#tick{write = Write + 1,
+ Sent = send_tick(Socket, Pend, MFTick),
+ {ok, Tick#tick{write = Write + Sent,
read = R,
tick = T1,
ticked = T}};
@@ -772,10 +772,11 @@ send_tick(Socket, Tick, Type, MFTick, MFGetstat) ->
end.
send_tick(Socket, 0, MFTick) ->
- MFTick(Socket);
+ MFTick(Socket),
+ 1;
send_tick(_, _Pend, _) ->
%% Dont send tick if pending write.
- ok.
+ 0.
%% ------------------------------------------------------------
%% Connection setup timeout timer.