24
1
mirror of https://github.com/processone/ejabberd.git synced 2024-06-06 21:37:17 +02:00

Correct some function clauses and value types

This commit is contained in:
Evgeniy Khramtsov 2011-09-05 16:31:58 +10:00
parent ffe063a0e9
commit f1a91108ef

View File

@ -353,7 +353,7 @@ process_request(#state{request_method = Method,
when Method=:='GET' orelse Method=:='HEAD' orelse Method=:='DELETE' orelse Method=:='OPTIONS' -> when Method=:='GET' orelse Method=:='HEAD' orelse Method=:='DELETE' orelse Method=:='OPTIONS' ->
case (catch url_decode_q_split(Path)) of case (catch url_decode_q_split(Path)) of
{'EXIT', _} -> {'EXIT', _} ->
process_request(false); make_bad_request(State);
{NPath, Query} -> {NPath, Query} ->
LPath = [path_decode(NPE) || NPE <- string:tokens(NPath, "/")], LPath = [path_decode(NPE) || NPE <- string:tokens(NPath, "/")],
LQuery = case (catch parse_urlencoded(Query)) of LQuery = case (catch parse_urlencoded(Query)) of
@ -430,7 +430,7 @@ process_request(#state{request_method = Method,
?DEBUG("client data: ~p~n", [Data]), ?DEBUG("client data: ~p~n", [Data]),
case (catch url_decode_q_split(Path)) of case (catch url_decode_q_split(Path)) of
{'EXIT', _} -> {'EXIT', _} ->
process_request(false); make_bad_request(State);
{NPath, _Query} -> {NPath, _Query} ->
LPath = [path_decode(NPE) || NPE <- string:tokens(NPath, "/")], LPath = [path_decode(NPE) || NPE <- string:tokens(NPath, "/")],
LQuery = case (catch parse_urlencoded(Data)) of LQuery = case (catch parse_urlencoded(Data)) of
@ -464,6 +464,9 @@ process_request(#state{request_method = Method,
end; end;
process_request(State) -> process_request(State) ->
make_bad_request(State).
make_bad_request(State) ->
make_xhtml_output(State, make_xhtml_output(State,
400, 400,
[], [],
@ -506,7 +509,7 @@ recv_data(State, Len, Acc) ->
[] -> [] ->
case (State#state.sockmod):recv(State#state.socket, Len, 300000) of case (State#state.sockmod):recv(State#state.socket, Len, 300000) of
{ok, Data} -> {ok, Data} ->
recv_data(State, Len - size(Data), [Acc | Data]); recv_data(State, Len - size(Data), [Acc | [Data]]);
_ -> _ ->
"" ""
end; end;
@ -1089,8 +1092,8 @@ is_space(_) ->
strip_spaces(String) -> strip_spaces(String) ->
strip_spaces(String, both). strip_spaces(String, both).
strip_spaces(String, left) -> %% strip_spaces(String, left) ->
drop_spaces(String); %% drop_spaces(String);
strip_spaces(String, right) -> strip_spaces(String, right) ->
lists:reverse(drop_spaces(lists:reverse(String))); lists:reverse(drop_spaces(lists:reverse(String)));
strip_spaces(String, both) -> strip_spaces(String, both) ->