The file client_request.ex is rather large and it violates the single responsibility principle. It includes HTTP Web server functionality, e.g. with callbacks such as
def handle_info(
{:http, _, {:http_request, :GET, {:abs_path, "/"}, _}},
state = %CR{action: :recv_header}
) do
but also other application logic, e.g. with callbacks such as
def handle_cast({:filesize_increased, _},
state = %CR{waiting_for_no_dependencies_left: true}) do
Try to put the HTTP server functionality into a separate module. Write test cases for this module from the start, i.e., don't commit any additional functions unless there's a test cases that covers this new function.
The file
client_request.exis rather large and it violates the single responsibility principle. It includes HTTP Web server functionality, e.g. with callbacks such asbut also other application logic, e.g. with callbacks such as
Try to put the HTTP server functionality into a separate module. Write test cases for this module from the start, i.e., don't commit any additional functions unless there's a test cases that covers this new function.