anchor.diff:      end.
   
   
  -error_terminate(_Code, Socket) ->
  -    gen_tcp:send(Socket, [<<"400 Bad Request">>]),
  -    gen_tcp:close(Socket),
  -    exit(normal).
  -
  -
  -t(Key) ->
  -    put({time, Key}, os:timestamp()).
  -
  -get_timings() ->
  -    lists:flatmap(fun ({{time, Key}, Val}) ->
  -                          if
  -                              Key =:= accepted -> ok;
  -                              true -> erase({time, Key})
  -                          end,
  -                          [{Key, Val}];
  -                     (_) ->
  -                          []
  -                 end, get()).
  -
  -
  -parse_path({abs_path, FullPath}) ->
  -    case binary:split(FullPath, [<<"?">>]) of
  -        [URL]       -> {FullPath, split_path(URL), []};
  -        [URL, Args] -> {FullPath, split_path(URL), split_args(Args)}
  -    end.
  -
  -split_path(<<"/", Path/binary>>) ->
  -    binary:split(Path, [<<"/">>], [global, trim]);
  -split_path(Path) ->
  -    binary:split(Path, [<<"/">>], [global, trim]).
  -
  -
  -
  -
  -%% @doc: Splits the url arguments into a proplist. Lifted from
  -%% cowboy_http:x_www_form_urlencoded/2
  --spec split_args(binary()) -> list({binary(), binary() | true}).
  -split_args(<<>>) ->
  -	[];
  -split_args(Qs) ->
  -	Tokens = binary:split(Qs, <<"&">>, [global, trim]),
  -	[case binary:split(Token, <<"=">>) of
  -		[Token] -> {Token, true};
  -		[Name, Value] -> {Name, Value}
  -	end || Token <- Tokens].
  -
  -%%
  -%% RECEIVE REQUEST
  -%%
   
   -spec get_headers(port(), version(), binary(), callback()) ->
                            {headers(), any()}.
  
positive.code:     gen_tcp:send(Socket, Response).
  
  
  
  get_request(Socket, Callback) ->
      get_request(Socket, <<>>, Callback).
  
  
negative.code: 
  -spec accept(pid(), port(), callback()) -> ok.
  %% @doc: Accept on the socket until a client connects. Handles the
  %% request, then loops if we're using keep alive or chunked transfer.
  accept(Server, ListenSocket, Callback) ->
      case catch gen_tcp:accept(ListenSocket, 1000) of
          {ok, Socket} ->
              t(accepted),
              gen_server:cast(Server, accepted),
              ?MODULE:handle_request(Socket, Callback);
          {error, timeout} ->
              ?MODULE:accept(Server, ListenSocket, Callback);
          {error, closed} ->
  