Skip to content

Fix infinite recursion in HttpTracker::interval() trait method #173

@coderabbitai

Description

@coderabbitai

Description

The trait method interval() in HttpTracker (line 264-266 of crates/libtortillas/src/tracker/http.rs) currently calls self.interval(), which causes infinite recursion and will result in a stack overflow at runtime.

Location

  • File: crates/libtortillas/src/tracker/http.rs
  • Lines: 264-266

Current Code

fn interval(&self) -> usize {
   self.interval()
}

Suggested Fix

Replace the recursive call with a direct read of the atomic value:

fn interval(&self) -> usize {
   self.interval.load(Ordering::Acquire)
}

Context

This issue was identified during review of PR #172 and is considered out of scope for that PR.

References

Additional Notes

This is a good first issue for contributors new to the codebase as it involves a straightforward fix with a clear solution.

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions