Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • Tor Tor
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 325
    • Issues 325
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 30
    • Merge requests 30
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • The Tor Project
  • Core
  • TorTor
  • Issues
  • #13840
Closed
Open
Issue created Nov 25, 2014 by Roger Dingledine@armaReporter

Refactor? Use END_CIRC_REASON_TORPROTOCOL rather than "1" in connection_exit_begin_conn()

In the function comment for connection_exit_begin_conn() we see

 * Return -(some circuit end reason) if we want to tear down <b>circ</b>.
 * Else return 0.

and then at the front of the function we see

  if (rh.length > RELAY_PAYLOAD_SIZE)
    return -1;

Now, it happens that 1 is END_CIRC_REASON_TORPROTOCOL, which is a legitimate reason to use in this case. But did we just get lucky?

Later there's also a

  if (r < -1) {
    return -1;

If we want to go wilder with the change here, I think this function actually only ever returns 0 and -1, so it's not actually following the function comment and we could get rid of that part of it instead?

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking