Skip to content
Snippets Groups Projects

Remove the use of Mutex in channel unused_since timestamp

Merged yuan requested to merge 0x00A5/arti:issue-324 into main
3 unresolved threads

Create OptTimestamp so that we can remove the use of Mutex in channel details' unused_since timestamp as described in issue #324 (closed) .

Edited by yuan

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
580 580 fn note_circ_timeout(&mut self, hop: u8, delay: Duration) {
581 581 // Only record this timeout if we have seen some network activity since
582 582 // we launched the circuit.
583 let last_traffic = tor_proto::time_since_last_incoming_traffic();
584 let have_seen_recent_activity = last_traffic < delay;
583 let have_seen_recent_activity =
584 if let Some(last_traffic) = tor_proto::time_since_last_incoming_traffic() {
585 last_traffic < delay
586 } else {
587 true
  • yuan
    yuan @0x00A5 started a thread on the diff
  • 470 470 // we don't mark all the primary guards as retriable unless
    471 471 // we've been forced to non-primary guards.
    472 let net_has_been_down = inner
    473 .guards
    474 .active_guards_mut()
    475 .all_primary_guards_are_unreachable()
    476 && tor_proto::time_since_last_incoming_traffic() >= inner.params.internet_down_timeout;
    472 let net_has_been_down =
    473 if let Some(duration) = tor_proto::time_since_last_incoming_traffic() {
    474 inner
    475 .guards
    476 .active_guards_mut()
    477 .all_primary_guards_are_unreachable()
    478 && duration >= inner.params.internet_down_timeout
    479 } else {
    480 false
  • yuan marked this merge request as ready

    marked this merge request as ready

  • Looks good!

  • Nick Mathewson mentioned in commit e8244c33

    mentioned in commit e8244c33

  • mentioned in issue #324 (closed)

  • Please register or sign in to reply
    Loading