Skip to content
This repository
Browse code

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

  • Loading branch information...
commit 1939b381ffda5ab426005b4d937e208a0e95c434 1 parent 589b535
Claes Wikstrom authored October 17, 2012
2  scripts/make-release
@@ -47,7 +47,7 @@ echo release resides in `pwd`/$NAME_VERSION.tar.gz
47 47
 echo release resides in `pwd`/yaws/win32/Yaws-${YAWS_VSN}-windows-installer.exe
48 48
 
49 49
 echo "To push this do:"
50  
-echo "git push origin revs/tags/yaws-${version}:revs/tags/yaws-${version}"
  50
+#echo "git push origin revs/tags/yaws-${version}:revs/tags/yaws-${version}"
51 51
 echo "ehhh or git push --tags"
52 52
 
53 53
 
6  src/yaws_server.erl
@@ -3893,7 +3893,7 @@ deliver_large_file(CliSock,  _Req, UT, Range) ->
3893 3893
 
3894 3894
 send_file(CliSock, Path, all, undefined) when is_port(CliSock) ->
3895 3895
     ?Debug("send_file(~p,~p,no ...)~n", [CliSock, Path]),
3896  
-    {ok, Size} = yaws_sendfile:send(CliSock, Path),
  3896
+    Size = yaws_sendfile:send(CliSock, Path),
3897 3897
     yaws_stats:sent(Size);
3898 3898
 send_file(CliSock, Path, all, undefined) ->
3899 3899
     ?Debug("send_file(~p,~p,no ...)~n", [CliSock, Path]),
@@ -3901,7 +3901,7 @@ send_file(CliSock, Path, all, undefined) ->
3901 3901
     send_file(CliSock, Fd, undefined);
3902 3902
 send_file(CliSock, _, all, {gzfile, GzFile}) when is_port(CliSock) ->
3903 3903
     ?Debug("send_file(~p,~p, ...)~n", [CliSock, GzFile]),
3904  
-    {ok, Size} = yaws_sendfile:send(CliSock, GzFile),
  3904
+    Size = yaws_sendfile:send(CliSock, GzFile),
3905 3905
     yaws_stats:sent(Size);
3906 3906
 send_file(CliSock, _, all, {gzfile, GzFile}) ->
3907 3907
     ?Debug("send_file(~p,~p, ...)~n", [CliSock, GzFile]),
@@ -3912,7 +3912,7 @@ send_file(CliSock, Path, all, Priv) ->
3912 3912
     {ok, Fd} = file:open(Path, [raw, binary, read]),
3913 3913
     send_file(CliSock, Fd, Priv);
3914 3914
 send_file(CliSock, Path,  {fromto, From, To, _Tot}, _) when is_port(CliSock) ->
3915  
-    {ok, Size} = yaws_sendfile:send(CliSock, Path, From, (To-From+1)),
  3915
+    Size = yaws_sendfile:send(CliSock, Path, From, (To-From+1)),
3916 3916
     yaws_stats:sent(Size);
3917 3917
 send_file(CliSock, Path,  {fromto, From, To, _Tot}, _) ->
3918 3918
     {ok, Fd} = file:open(Path, [raw, binary, read]),
5  src/yaws_stats.erl
@@ -50,7 +50,10 @@ hit() ->
50 50
 	    gen_server:cast(Pid, {hit})
51 51
     end.
52 52
 
53  
-
  53
+sent({ok, Bytes}) ->
  54
+    sent(Bytes);
  55
+sent({error, _}) ->
  56
+    ignore;
54 57
 sent(Bytes) ->
55 58
     case get_stats() of
56 59
 	undefined ->

0 notes on commit 1939b38

Please sign in to comment.
Something went wrong with that request. Please try again.