Use a switch-statement when checking for compression method.
commitc171af048731cc00d77e17a1ff0be5c641024f8a
authorAlexander Færøy <ahf@torproject.org>
Tue, 18 Apr 2017 01:39:43 +0000 (18 03:39 +0200)
committerNick Mathewson <nickm@torproject.org>
Tue, 25 Apr 2017 12:06:01 +0000 (25 08:06 -0400)
treee4e5fd4c89c8002e8ad3e1744516e43be154bdf5
parent300ac496853448eb3eeb3529d3aedaa8cc212ec3
Use a switch-statement when checking for compression method.

This patch changes the way `tor_compress_new()`,
`tor_compress_process()`, and `tor_compress_free()` handles different
compression methods. This should give us compiler warnings in case an
additional compression method is added, but the developer forgets to add
handlers in the three aforementioned functions.

See https://bugs.torproject.org/21663
src/common/compress.c