client allow remote server to accept with no protocol set 19/2919/1
authorAndy Green <andy.green@linaro.org>
Wed, 16 Jan 2013 16:50:48 +0000 (00:50 +0800)
committerKevron Rees <kevron_m_rees@linux.intel.com>
Thu, 7 Mar 2013 21:01:26 +0000 (13:01 -0800)
Needed if our clientside can connect to, eg, echo.websocket.org

Signed-off-by: Andy Green <andy.green@linaro.org>
lib/client.c

index 027fb77..bb54033 100644 (file)
@@ -341,9 +341,8 @@ lws_client_interpret_server_handshake(struct libwebsocket_context *context,
                if (!wsi->utf8_token[WSI_TOKEN_HTTP].token_len ||
                        !wsi->utf8_token[WSI_TOKEN_UPGRADE].token_len ||
                        !wsi->utf8_token[WSI_TOKEN_CHALLENGE].token_len ||
-                       !wsi->utf8_token[WSI_TOKEN_CONNECTION].token_len ||
-                       (!wsi->utf8_token[WSI_TOKEN_PROTOCOL].token_len &&
-                       wsi->c_protocol != NULL)) {
+                       !wsi->utf8_token[WSI_TOKEN_CONNECTION].token_len
+               ) {
                        lwsl_parser("libwebsocket_client_handshake "
                                        "missing required header(s)\n");
                        pkt[len] = '\0';
@@ -396,11 +395,10 @@ lws_client_interpret_server_handshake(struct libwebsocket_context *context,
            !wsi->utf8_token[WSI_TOKEN_CONNECTION].token_len ||
            !wsi->utf8_token[WSI_TOKEN_ACCEPT].token_len ||
            (!wsi->utf8_token[WSI_TOKEN_NONCE].token_len &&
-                                  wsi->ietf_spec_revision == 4) ||
-           (!wsi->utf8_token[WSI_TOKEN_PROTOCOL].token_len &&
-                                                   wsi->c_protocol != NULL)) {
+                                  wsi->ietf_spec_revision == 4)
+       ) {
                lwsl_parser("libwebsocket_client_handshake "
-                                       "missing required header(s)\n");
+                                       "missing required header(s) revision=%d\n", wsi->ietf_spec_revision);
                pkt[len] = '\0';
                lwsl_parser("%s", pkt);
                goto bail3;
@@ -453,7 +451,7 @@ select_protocol:
 
        if (!wsi->utf8_token[WSI_TOKEN_PROTOCOL].token_len) {
 
-               lwsl_warn("lws_client_interpret_server_handshake "
+               lwsl_info("lws_client_interpret_server_handshake "
                                               "WSI_TOKEN_PROTOCOL is null\n");
                /*
                 * no protocol name to work from,