Skip to content

Commit

Permalink
dnt_net: always increment singleMes in send request retries
Browse files Browse the repository at this point in the history
  • Loading branch information
vyzo committed Sep 17, 2017
1 parent c4f4864 commit c0e98e4
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions dht_net.go
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,9 @@ func (ms *messageSender) SendRequest(ctx context.Context, pmes *pb.Message) (*pb
}

if err := ms.w.WriteMsg(pmes); err != nil {
if retry {
ms.singleMes++
}
ms.resetHard()
ms.lk.Unlock()

Expand Down Expand Up @@ -289,6 +292,9 @@ func (ms *messageSender) SendRequest(ctx context.Context, pmes *pb.Message) (*pb

if res.err != nil {
ms.lk.Lock()
if retry {
ms.singleMes++
}
ms.resetSoft(rcount)
ms.lk.Unlock()

Expand Down

0 comments on commit c0e98e4

Please sign in to comment.