Permalink
Browse files

do not give port time if bytes remain in request pipe

  • Loading branch information...
1 parent 5c44cc8 commit 21355df13cff3bc1131438edc0bc370eca9fa63b @mojombo committed Jul 10, 2008
Showing with 6 additions and 1 deletion.
  1. +6 −1 elibs/upload_pack.erl
View
7 elibs/upload_pack.erl
@@ -103,7 +103,12 @@ get_request_from_client(RequestPipe, ResponsePipe, Port, Sock, Host, Path) ->
io:format("req = ~p~n", [Request]),
log_request(Request, Host, Path),
port_command(Port, Request),
- send_response_to_client(Status, RequestPipe2, ResponsePipe, Port, Sock, Host, Path);
+ case pipe:size(RequestPipe2) > 0 of
+ true ->
+ get_request_from_client(RequestPipe2, ResponsePipe, Port, Sock, Host, Path);
+ false ->
+ send_response_to_client(Status, RequestPipe2, ResponsePipe, Port, Sock, Host, Path)
+ end;
{error, closed} ->
io:format("socket closed~n"),
ok = gen_tcp:close(Sock),

0 comments on commit 21355df

Please sign in to comment.