Opened 5 months ago

Closed 3 months ago

#28816 closed defect (fixed)

Call a correct connection_buf_add* function based on compress_state of dir_connection_t

Reported by: teor Owned by: rl1987
Priority: Medium Milestone: Tor: 0.4.1.x-final
Component: Core Tor/Tor Version:
Severity: Normal Keywords: technical-debt, tor-dir, tor-bwauth
Cc: Actual Points:
Parent ID: #21377 Points:
Reviewer: nickm Sponsor:

Description

In #21377, we discovered that it is easy to set the compression state on a connection, but add uncompressed data to that connection.

We should log a bug warning when:

  • conn->compress_state is not NULL, and connection_buf_add() is called
  • conn->compress_state is NULL, and connection_buf_add_compress() is called

Child Tickets

Change History (10)

comment:1 Changed 5 months ago by teor

Parent ID: #21377

Let's think about fixing this technical debt before merging #21377.

comment:2 Changed 4 months ago by rl1987

Owner: set to rl1987
Status: newaccepted

comment:3 Changed 4 months ago by rl1987

compress_state is actually a member of dir_connection_t struct. Idea: we could create dir_connection_buf_add() and connection_buf_add_compress() functions that check for compress_state being set and prints the stacktrace if needed.

comment:4 Changed 4 months ago by teor

Sounds good to me!

We could also just call the correct function based on compress_state. There might have been a reason why that wouldn't work.

comment:5 Changed 3 months ago by rl1987

Summary: Log a bug for uncompressed data on a compressed connectionCall a correct connection_buf_add* function based on compress state of dir_connection_t

comment:6 Changed 3 months ago by rl1987

Summary: Call a correct connection_buf_add* function based on compress state of dir_connection_tCall a correct connection_buf_add* function based on compress_state of dir_connection_t

comment:7 Changed 3 months ago by rl1987

Status: acceptedneeds_review

comment:8 Changed 3 months ago by dgoulet

Reviewer: nickm

comment:9 Changed 3 months ago by nickm

Milestone: Tor: unspecifiedTor: 0.4.1.x-final
Status: needs_reviewmerge_ready

LGTM!

comment:10 Changed 3 months ago by dgoulet

Resolution: fixed
Status: merge_readyclosed

Merged in master!

Note: See TracTickets for help on using tickets.