You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by be...@apache.org on 2014/02/13 17:06:35 UTC

[40/50] mochiweb commit: updated refs/heads/import-upstream to 8eb1f22

clean up conditionals


Project: http://git-wip-us.apache.org/repos/asf/couchdb-mochiweb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-mochiweb/commit/ef24a573
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-mochiweb/tree/ef24a573
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-mochiweb/diff/ef24a573

Branch: refs/heads/import-upstream
Commit: ef24a5733ea31b642d6ce7fa48c61ebd8a585311
Parents: 5501126
Author: Bob Ippolito <bo...@redivi.com>
Authored: Wed Dec 25 15:33:36 2013 -0800
Committer: Bob Ippolito <bo...@redivi.com>
Committed: Wed Dec 25 15:33:36 2013 -0800

----------------------------------------------------------------------
 src/mochiweb_websocket.erl | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-mochiweb/blob/ef24a573/src/mochiweb_websocket.erl
----------------------------------------------------------------------
diff --git a/src/mochiweb_websocket.erl b/src/mochiweb_websocket.erl
index 5224312..3b87629 100644
--- a/src/mochiweb_websocket.erl
+++ b/src/mochiweb_websocket.erl
@@ -104,16 +104,14 @@ make_handshake(Req) ->
     Sec1Key = Req:get_header_value("Sec-WebSocket-Key1"),
     Sec2Key = Req:get_header_value("Sec-WebSocket-Key2"),
     Origin = Req:get_header_value(origin),
-    if not (SecKey == undefined) ->
-          hybi_handshake(SecKey);
-
-        (not (Sec1Key == undefined)) and (not (Sec2Key == undefined)) ->
+    if SecKey =/= undefined ->
+            hybi_handshake(SecKey);
+       Sec1Key =/= undefined andalso Sec2Key =/= undefined ->
             Host = Req:get_header_value("Host"),
             Path = Req:get(path),
             Body = Req:recv(8),
             Scheme = scheme(Req),
             hixie_handshake(Scheme, Host, Path, Sec1Key, Sec2Key, Body, Origin);
-
        true ->
           error
     end.