From db86b9194dfc6759cd731f8eedc37b7534afbf0d Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Tue, 2 May 2017 13:06:25 -0400 Subject: Break connection_dir_client_reached_eof() into smaller functions This was a >630-line function, which doesn't make anybody happy. It was also mostly composed of a bunch of if-statements that handled different directory responses differently depending on the original purpose of the directory connection. The logical refactoring here is to move the body of each switch statement into a separate handler function, and to invoke those functions from a separate switch statement. This commit leaves whitespace mostly untouched, for ease of review. I'll reindent in the next commit. --- changes/refactor_reached_eof | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 changes/refactor_reached_eof (limited to 'changes') diff --git a/changes/refactor_reached_eof b/changes/refactor_reached_eof new file mode 100644 index 0000000000..33ab931b9b --- /dev/null +++ b/changes/refactor_reached_eof @@ -0,0 +1,5 @@ + o Code simplification and refactoring: + + - Break up the 630-line function connection_dir_client_reached_eof() into + a dozen smaller functions. This change should help maintainability and + readability of the client directory code. -- cgit v1.2.3-54-g00ecf