Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • Trac Trac
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Issues 246
    • Issues 246
    • List
    • Boards
    • Service Desk
    • Milestones
  • Monitor
    • Monitor
    • Metrics
    • Incidents
  • Analytics
    • Analytics
    • Value stream
  • Wiki
    • Wiki
  • Activity
  • Create a new issue
  • Issue Boards
Collapse sidebar
  • Legacy
  • TracTrac
  • Issues
  • #13840

Closed (moved)
(moved)
Open
Created Nov 25, 2014 by Roger Dingledine@arma

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