Skip to content

Refactor HTTP Server functionality into separate module #17

@nroi

Description

@nroi

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.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions