Opened 3 months ago

Closed 3 months ago

#32343 closed enhancement (implemented)

circ: Add a HANDLE() to circuit_t

Reported by: dgoulet Owned by: dgoulet
Priority: Medium Milestone: Tor: 0.4.3.x-final
Component: Core Tor/Tor Version:
Severity: Normal Keywords: tor-circuit
Cc: Actual Points: 0.1
Parent ID: Points: 0.1
Reviewer: nickm Sponsor:

Description

Overall better to start using handles instead of map lookup by GID which only works for origin circuit.

A HANDLE in the circuit_t object would allow us for instance to put in the circuit reference into a pubsub message instead of its raw pointer that could be freed during a mainloop event preceding the pubsub callback(s).

Child Tickets

Change History (7)

comment:1 Changed 3 months ago by dgoulet

Actual Points: 0.1
Points: 0.1
Reviewer: nickm
Status: assignedneeds_review

Branch: ticket32343_043_01
PR: https://github.com/torproject/tor/pull/1485

comment:2 Changed 3 months ago by nickm

Looks good -- just left a small comment.

comment:3 Changed 3 months ago by nickm

Status: needs_reviewneeds_revision

comment:4 Changed 3 months ago by dgoulet

Status: needs_revisionneeds_review

Fixed! Move the DECL() to circuitlist.h since the IMPL() is in circuitlist.c and that file also handles allocation + init of a circuit_t.

comment:5 Changed 3 months ago by nickm

Status: needs_reviewneeds_revision

Okay, there's one change I forgot to ask for. Sorry!

When we free a circuit_t, we need to call circuit_handles_clear(), to avoid dangling references

comment:6 Changed 3 months ago by dgoulet

Status: needs_revisionneeds_review

comment:7 Changed 3 months ago by nickm

Resolution: implemented
Status: needs_reviewclosed

Merged!

Note: See TracTickets for help on using tickets.