anchor.diff:      _:_ -> ok
     end.
   
  +%****************************************************************************
  +% gather_request
  +
   gather_request(Sock, Pipe) ->
     gather_request(Sock, [], Pipe).
   gather_request(Sock, DataSoFar, Pipe) ->
     try
       {ok, Data, P2} = read_chunk_from_socket(Sock, Pipe),
  -    % io:format("~p~n", [Data]),
  +    io:format("~p~n", [Data]),
       TotalData = lists:append(DataSoFar, [Data]),
  -    case Data =:= <<"0000">> orelse Data =:= <<"0009done\n">> of
  +    case pipe:size(P2) == 0 andalso (Data =:= <<"0000">> orelse Data =:= <<"0009done\n">>) of
         true ->
           {ok, binary_to_list(list_to_binary(TotalData)), P2};
         false ->
  
positive.code:   
  % Send a response to the client
  send_response_to_client(RequestPipe, ResponsePipe, Port, Sock, Host, Path) ->
    % io:format("send response~n"),
    stream_out(Port, Sock, ResponsePipe),
    get_request_from_client(RequestPipe, ResponsePipe, Port, Sock, Host, Path).
  
  % Read a request from a client
  get_request_from_client(RequestPipe, ResponsePipe, Port, Sock, Host, Path) ->
    % io:format("get request~n"),
    case gather_request(Sock, RequestPipe) of
      {ok, Request, RequestPipe2} ->
        % io:format("req = ~p~n", [Request]),
  
negative.code: stream_out(Port, Sock, Pipe) ->
    % io:format("stream out "),
    {ok, Data, P2} = read_chunk(Port, Pipe),
    io:format("~p~n", [Data]),
    gen_tcp:send(Sock, Data),
    case pipe:size(P2) =:= 0 andalso Data =:= <<"0000">> of
      true  -> done;
      false -> stream_out(Port, Sock, P2)
    end.
  