[Webkit-unassigned] [Bug 81443] [WebSocket]The minimal number of bytes MUST be used to encode the length

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Mar 20 10:50:33 PDT 2012


https://bugs.webkit.org/show_bug.cgi?id=81443





--- Comment #11 from Yuta Kitamura <yutak at chromium.org>  2012-03-20 10:50:32 PST ---
(From update of attachment 132476)
View in context: https://bugs.webkit.org/attachment.cgi?id=132476&action=review

The code looks okay, but the test can be improved.

> Source/WebCore/ChangeLog:8
> +        [WebSocket]The minimal number of bytes MUST be used to encode the length
> +        https://bugs.webkit.org/show_bug.cgi?id=81443
> +        From RFC 6455 http://tools.ietf.org/html/rfc6455#section-5.2
> +        the minimal number of bytes MUST be used to encode the length
> +
> +        Reviewed by NOBODY (OOPS!).

Our ChangeLog format is usually:

  <bug title>
  <bug URL>

  Reviewed by ...

  <more description>

> LayoutTests/http/tests/websocket/tests/hybi/invalid-encode-length_wsh.py:12
> +    # pywebsocket refuses to create a frame with error encode length.
> +    # Thus, we need to build a frame manually.

You can use create_header() function from mod_pywebsocket.stream module to build a (possibly incorrect) frame header. See reserved-bits_wsh.py for example.

> LayoutTests/http/tests/websocket/tests/hybi/invalid-encode-length_wsh.py:14
> +    header += chr(126) # No Mask and two bytes extended payload length.

It would be better if we could test the edge cases like
  a) payload len = 126, extended payload length = 125
  b) payload len = 127, extended payload length = 0xFFFF
  c) payload len = {126,127}, extended payload length = 0

To test multiple cases, you may want to make use of query parameters in the URL; see protocol-test_wsh.py or reserved-bits_wsh.py for example.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list