Skip to content
Browse files

Fixed dialyzer bugs found by Tuncer, Issue #54

  • Loading branch information...
1 parent 5ea40d4 commit f73d23dc94c7e9d250b5428c7462abdeb019532b @klacke committed Feb 23, 2011
Showing with 13 additions and 11 deletions.
  1. +3 −1 src/yaws.erl
  2. +1 −1 src/yaws_content_negotiation.erl
  3. +2 −2 src/yaws_ctl.erl
  4. +1 −4 src/yaws_rpc.erl
  5. +4 −1 src/yaws_server.erl
  6. +1 −1 src/yaws_session_server.erl
  7. +1 −1 test/ibrowse/src/Makefile
View
4 src/yaws.erl
@@ -1770,7 +1770,9 @@ ensure_exist(Path) ->
%%
do_recv(Sock, Num, nossl) ->
- gen_tcp:recv(Sock, Num, (get(gc))#gconf.keepalive_timeout);
+ X=gen_tcp:recv(Sock, Num, (get(gc))#gconf.keepalive_timeout),
+ io:format("X = ~p~n", [X]),
+ X;
do_recv(Sock, Num, ssl) ->
ssl:recv(Sock, Num, (get(gc))#gconf.keepalive_timeout).
View
2 src/yaws_content_negotiation.erl
@@ -27,7 +27,7 @@ compute_rsva(Arg, VariantList) ->
URI
end.
-get_other_header(Name, Headers) ->
+get_other_header(Name, Headers#headers.other) ->
case lists:keysearch(Name, 3, Headers) of
{value, {_,_,Name,_,Field}} -> Field;
false -> undefined
View
4 src/yaws_ctl.erl
@@ -397,9 +397,9 @@ connect_file(CtlFile) ->
{packet, 2}], 2000) of
{ok, Socket} ->
case inet:port(Socket) of
- Port ->
+ {ok,Port} ->
{error, erefused};
- _ ->
+ _X ->
{ok, Socket, Key}
end;
Err ->
View
5 src/yaws_rpc.erl
@@ -260,10 +260,7 @@ encode_send(Args, StatusCode, Payload, AddOn, ID, RpcType) -> % {{{
send(Args, StatusCode, EncodedPayload, AddOn, NewRpcType);
{ok, EncodedPayload} ->
% ?Debug("rpc encoded response ~p ~n", [EncodedPayload]),
- send(Args, StatusCode, EncodedPayload, AddOn, RpcType);
- {error, Reason} ->
- ?ERROR_LOG({rpc_encode, payload, Payload, Reason}),
- send(Args, 500, RpcType)
+ send(Args, StatusCode, EncodedPayload, AddOn, RpcType)
end. % }}}
send(Args, StatusCode) -> send(Args, StatusCode, json).
View
5 src/yaws_server.erl
@@ -2769,10 +2769,13 @@ skip_data(Bin, Fd, Sz) when is_binary(Bin) ->
<<Head:Sz/binary ,Tail/binary>> ->
{Head, Tail};
_ ->
- case (catch file:read(Fd, 4000)) of
+ case (catch ut_read(Fd)) of
{ok, Bin2} when is_binary(Bin2) ->
Bin3 = <<Bin/binary, Bin2/binary>>,
skip_data(Bin3, Fd, Sz);
+ Bin2 when is_binary(Bin2) ->
+ Bin3 = <<Bin/binary, Bin2/binary>>,
+ skip_data(Bin3, Fd, Sz);
_Err ->
?Debug("EXIT in skip_data: ~p ~p ~p~n", [Bin, Sz, _Err]),
exit(normal)
View
2 src/yaws_session_server.erl
@@ -87,7 +87,7 @@ cookieval_to_opaque(Cookie) ->
gen_server:call(?MODULE, {cookieval_to_opaque, Cookie}, infinity).
print_sessions() ->
- gen_server:cast(?MODULE, print_sessions, infinity).
+ gen_server:cast(?MODULE, print_sessions).
replace_session(Cookie, NewOpaque) ->
gen_server:call(?MODULE, {replace_session, Cookie, NewOpaque}, infinity).
View
2 test/ibrowse/src/Makefile
@@ -11,7 +11,7 @@ INCLUDE_DIRS = -I./
ERLC ?= erlc
ERLC_EMULATOR ?= erl -boot start_clean
-COMPILER_OPTIONS = -W +warn_unused_vars +nowarn_shadow_vars +warn_unused_import
+COMPILER_OPTIONS = -W +debug_info +warn_unused_vars +nowarn_shadow_vars +warn_unused_import
.SUFFIXES: .erl .beam $(SUFFIXES)
EBIN = ../ebin

0 comments on commit f73d23d

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