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.
This commit is contained in:
Nick Mathewson
2017-05-02 13:06:25 -04:00
parent fd437f2a02
commit db86b9194d
2 changed files with 286 additions and 38 deletions
+5
View File
@@ -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.