Opened 3 years ago

Closed 3 years ago

#22051 closed enhancement (implemented)

Use streaming compression API in the non-streaming compression API

Reported by: ahf Owned by: nickm
Priority: Medium Milestone: Tor: 0.3.1.x-final
Component: Core Tor/Tor Version:
Severity: Normal Keywords: sponsor4
Cc: ahf Actual Points: .2
Parent ID: Points: 1
Reviewer: Sponsor:


We currently have some code duplication in tor's compress/uncompress API and the streaming compression/decompression API.

It could make sense to check if the streaming API could be used to implement tor_gzip_compress() and tor_gzip_uncompress() (and the new LZMA & Zstandard implementations when they land).

Child Tickets

Change History (7)

comment:1 Changed 3 years ago by ahf

Cc: ahf added

comment:2 Changed 3 years ago by nickm

Owner: set to ahf
Status: newassigned

comment:3 Changed 3 years ago by nickm

Owner: changed from ahf to nickm
Status: assignedaccepted

comment:4 Changed 3 years ago by nickm

Actual Points: .2
Status: acceptedneeds_review

See branch unified_compress in my public repository. I'm looking at test coverage now.

comment:5 Changed 3 years ago by nickm

Okay, coverage on the unified function looks high.

comment:6 Changed 3 years ago by ahf

Status: needs_reviewmerge_ready

Looks good. I have one minor comment:

In 25a2ead3947b175856b1708e9876012e247c7d2f the BEST_COMPRESSION flag is introduced, but the // XXXX "best"? comment in tor_compress() isn't removed together with the introduction of the flag.

comment:7 Changed 3 years ago by nickm

Resolution: implemented
Status: merge_readyclosed

Fixed, squashed, merged. Thanks!

Note: See TracTickets for help on using tickets.