Title: [86659] trunk
Revision
86659
Author
[email protected]
Date
2011-05-17 00:37:11 -0700 (Tue, 17 May 2011)

Log Message

2011-05-16  Yuta Kitamura  <[email protected]>

        Reviewed by Kent Tamura.

        WebSocket: WebSocketHandshake prints a carriage return to console
        https://bugs.webkit.org/show_bug.cgi?id=60880

        * http/tests/websocket/tests/handshake-error-expected.txt:
        Remove a carriage return in the first line.

2011-05-16  Yuta Kitamura  <[email protected]>

        Reviewed by Kent Tamura.

        WebSocket: WebSocketHandshake prints a carriage return to console
        https://bugs.webkit.org/show_bug.cgi?id=60880

        * websockets/WebSocketHandshake.cpp:
        (WebCore::WebSocketHandshake::readStatusLine):
        WebSocketHandshake should not print a carriage return to console. To fix this,
        we first check whether the status line ends with CRLF. After that,
        we can print the first (lineLength - 2) characters of the status line
        which do not contain a carriage return.

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (86658 => 86659)


--- trunk/LayoutTests/ChangeLog	2011-05-17 06:59:15 UTC (rev 86658)
+++ trunk/LayoutTests/ChangeLog	2011-05-17 07:37:11 UTC (rev 86659)
@@ -1,3 +1,13 @@
+2011-05-16  Yuta Kitamura  <[email protected]>
+
+        Reviewed by Kent Tamura.
+
+        WebSocket: WebSocketHandshake prints a carriage return to console
+        https://bugs.webkit.org/show_bug.cgi?id=60880
+
+        * http/tests/websocket/tests/handshake-error-expected.txt:
+        Remove a carriage return in the first line.
+
 2011-05-16  Yuzo Fujishima  <[email protected]>
 
         Unreviewed Chromium test expectation change.

Modified: trunk/LayoutTests/http/tests/websocket/tests/handshake-error-expected.txt (86658 => 86659)


--- trunk/LayoutTests/http/tests/websocket/tests/handshake-error-expected.txt	2011-05-17 06:59:15 UTC (rev 86658)
+++ trunk/LayoutTests/http/tests/websocket/tests/handshake-error-expected.txt	2011-05-17 07:37:11 UTC (rev 86659)
@@ -1,4 +1,4 @@
-CONSOLE MESSAGE: line 0: No response code found: ThisWillCauseHandshakeError
+CONSOLE MESSAGE: line 0: No response code found: ThisWillCauseHandshakeError
 Handshake error test
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".

Modified: trunk/Source/WebCore/ChangeLog (86658 => 86659)


--- trunk/Source/WebCore/ChangeLog	2011-05-17 06:59:15 UTC (rev 86658)
+++ trunk/Source/WebCore/ChangeLog	2011-05-17 07:37:11 UTC (rev 86659)
@@ -1,3 +1,17 @@
+2011-05-16  Yuta Kitamura  <[email protected]>
+
+        Reviewed by Kent Tamura.
+
+        WebSocket: WebSocketHandshake prints a carriage return to console
+        https://bugs.webkit.org/show_bug.cgi?id=60880
+
+        * websockets/WebSocketHandshake.cpp:
+        (WebCore::WebSocketHandshake::readStatusLine):
+        WebSocketHandshake should not print a carriage return to console. To fix this,
+        we first check whether the status line ends with CRLF. After that,
+        we can print the first (lineLength - 2) characters of the status line
+        which do not contain a carriage return.
+
 2011-05-16  MORITA Hajime  <[email protected]>
 
         Unreviewed build fix for r86647, which broke SUPPORT_AUTOCORRECTION_PANEL.

Modified: trunk/Source/WebCore/websockets/WebSocketHandshake.cpp (86658 => 86659)


--- trunk/Source/WebCore/websockets/WebSocketHandshake.cpp	2011-05-17 06:59:15 UTC (rev 86658)
+++ trunk/Source/WebCore/websockets/WebSocketHandshake.cpp	2011-05-17 07:37:11 UTC (rev 86659)
@@ -450,20 +450,20 @@
         return -1; // We have not received '\n' yet.
 
     const char* end = p + 1;
-    if (end - header > maximumLength) {
+    int lineLength = end - header;
+    if (lineLength > maximumLength) {
         m_context->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, "Status line is too long", 0, clientOrigin(), 0);
         return maximumLength;
     }
-    int lineLength = end - header;
 
-    if (!space1 || !space2) {
-        m_context->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, "No response code found: " + trimConsoleMessage(header, lineLength - 1), 0, clientOrigin(), 0);
+    // The line must end with "\r\n".
+    if (lineLength < 2 || *(end - 2) != '\r') {
+        m_context->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, "Status line does not end with CRLF", 0, clientOrigin(), 0);
         return lineLength;
     }
 
-    // The line must end with "\r\n".
-    if (*(end - 2) != '\r') {
-        m_context->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, "Status line does not end with CRLF", 0, clientOrigin(), 0);
+    if (!space1 || !space2) {
+        m_context->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, "No response code found: " + trimConsoleMessage(header, lineLength - 2), 0, clientOrigin(), 0);
         return lineLength;
     }
 
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to