diff --git a/src/yaws_config.erl b/src/yaws_config.erl index 4c8ec19ca..ea492efc5 100644 --- a/src/yaws_config.erl +++ b/src/yaws_config.erl @@ -1781,17 +1781,18 @@ find_sc(_SC,[]) -> verify_upgrade_args(GC, Groups0) when is_record(GC, gconf) -> case is_groups(Groups0) of true -> - %% embeded code may give appmods as a list of strings - %% So the above is for backwards compatibility - %% appmods should be {StringPathElem, ModAtom} or {StringPathElem,ModAtom,ExcludePathsList} tuples + %% Embedded code may give appmods as a list of strings, or + %% appmods can be {StringPathElem,ModAtom} or + %% {StringPathElem,ModAtom,ExcludePathsList} tuples. Handle + %% all possible variants here. Groups = yaws:deepmap( fun(SC) -> SC#sconf{appmods = lists:map( fun({PE, Mod}) -> {PE, Mod}; - ({PE,Mod,Ex}) -> - {PE,Mod,Ex}; + ({PE,Mod,Ex}) -> + {PE,Mod,Ex}; (AM) when is_list(AM) -> {AM,list_to_atom(AM)}; (AM) when is_atom(AM) -> diff --git a/src/yaws_server.erl b/src/yaws_server.erl index 1a1229e98..024958f36 100644 --- a/src/yaws_server.erl +++ b/src/yaws_server.erl @@ -922,12 +922,13 @@ acceptor0(GS, Top) -> ok end, Res = (catch aloop(Client, GS, 0)), - %% Skip closing the socket, as required by web sockets & stream processes. + %% Skip closing the socket, as required by web sockets & stream + %% processes. CloseSocket = (get(outh) =:= undefined) orelse (done_or_continue() =:= done), case CloseSocket of - false -> ok; - true -> + false -> ok; + true -> if GS#gs.ssl == nossl -> gen_tcp:close(Client); @@ -2355,11 +2356,9 @@ deliver_dyn_part(CliSock, % essential params no, undefined, stream), wait_for_streamcontent_pid(Priv, CliSock, Pid); {websocket, OwnerPid, SocketMode} -> - %% The handshake passes control over the socket to OwnerPid - %% and terminates the Yaws worker! - yaws_websockets:handshake(Arg, OwnerPid, SocketMode) - %% this point is never reached - ; + %% The handshake passes control over the socket to OwnerPid + %% and terminates the Yaws worker! + yaws_websockets:handshake(Arg, OwnerPid, SocketMode); _ -> DeliverCont(Arg) end. @@ -2781,9 +2780,9 @@ handle_out_reply({streamcontent_from_pid, MimeType, Pid}, {streamcontent_from_pid, MimeType, Pid}; handle_out_reply({websocket, _OwnerPid, _SocketMode}=Reply, - _LineNo,_YawsFile, _UT, _ARG) -> - yaws:accumulate_header({connection, erase}), - Reply; + _LineNo,_YawsFile, _UT, _ARG) -> + yaws:accumulate_header({connection, erase}), + Reply; handle_out_reply({header, H}, _LineNo, _YawsFile, _UT, _ARG) -> yaws:accumulate_header(H);