Permalink
Browse files

make error reports for stats:sent() go away nd be ignored

  • Loading branch information...
1 parent 589b535 commit 1939b381ffda5ab426005b4d937e208a0e95c434 @klacke committed Oct 17, 2012
Showing with 8 additions and 5 deletions.
  1. +1 −1 scripts/make-release
  2. +3 −3 src/yaws_server.erl
  3. +4 −1 src/yaws_stats.erl
@@ -47,7 +47,7 @@ echo release resides in `pwd`/$NAME_VERSION.tar.gz
echo release resides in `pwd`/yaws/win32/Yaws-${YAWS_VSN}-windows-installer.exe
echo "To push this do:"
-echo "git push origin revs/tags/yaws-${version}:revs/tags/yaws-${version}"
+#echo "git push origin revs/tags/yaws-${version}:revs/tags/yaws-${version}"
echo "ehhh or git push --tags"
View
@@ -3893,15 +3893,15 @@ deliver_large_file(CliSock, _Req, UT, Range) ->
send_file(CliSock, Path, all, undefined) when is_port(CliSock) ->
?Debug("send_file(~p,~p,no ...)~n", [CliSock, Path]),
- {ok, Size} = yaws_sendfile:send(CliSock, Path),
+ Size = yaws_sendfile:send(CliSock, Path),
yaws_stats:sent(Size);
send_file(CliSock, Path, all, undefined) ->
?Debug("send_file(~p,~p,no ...)~n", [CliSock, Path]),
{ok, Fd} = file:open(Path, [raw, binary, read]),
send_file(CliSock, Fd, undefined);
send_file(CliSock, _, all, {gzfile, GzFile}) when is_port(CliSock) ->
?Debug("send_file(~p,~p, ...)~n", [CliSock, GzFile]),
- {ok, Size} = yaws_sendfile:send(CliSock, GzFile),
+ Size = yaws_sendfile:send(CliSock, GzFile),
yaws_stats:sent(Size);
send_file(CliSock, _, all, {gzfile, GzFile}) ->
?Debug("send_file(~p,~p, ...)~n", [CliSock, GzFile]),
@@ -3912,7 +3912,7 @@ send_file(CliSock, Path, all, Priv) ->
{ok, Fd} = file:open(Path, [raw, binary, read]),
send_file(CliSock, Fd, Priv);
send_file(CliSock, Path, {fromto, From, To, _Tot}, _) when is_port(CliSock) ->
- {ok, Size} = yaws_sendfile:send(CliSock, Path, From, (To-From+1)),
+ Size = yaws_sendfile:send(CliSock, Path, From, (To-From+1)),
yaws_stats:sent(Size);
send_file(CliSock, Path, {fromto, From, To, _Tot}, _) ->
{ok, Fd} = file:open(Path, [raw, binary, read]),
View
@@ -50,7 +50,10 @@ hit() ->
gen_server:cast(Pid, {hit})
end.
-
+sent({ok, Bytes}) ->
+ sent(Bytes);
+sent({error, _}) ->
+ ignore;
sent(Bytes) ->
case get_stats() of
undefined ->

0 comments on commit 1939b38

Please sign in to comment.