⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 101974 in webkit


Ignore:
Timestamp:
Dec 4, 2011, 11:42:19 PM (15 years ago)
Author:
commit-queue@webkit.org
Message:

Add binary support in WebSocket test server's echo handler.
https://bugs.webkit.org/show_bug.cgi?id=73649

Patch by Takashi Toyoshima <toyoshim@chromium.org> on 2011-12-04
Reviewed by Eric Seidel.

  • http/tests/websocket/tests/hybi/echo_wsh.py: Support binary frames.
Location:
trunk/LayoutTests
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r101971 r101974  
     12011-12-04  Takashi Toyoshima  <toyoshim@chromium.org>
     2
     3        Add binary support in WebSocket test server's echo handler.
     4        https://bugs.webkit.org/show_bug.cgi?id=73649
     5
     6        Reviewed by Eric Seidel.
     7
     8        * http/tests/websocket/tests/hybi/echo_wsh.py: Support binary frames.
     9
    1102011-12-04  Kent Tamura  <tkent@chromium.org>
    211
  • trunk/LayoutTests/http/tests/websocket/tests/hybi/echo_wsh.py

    r90726 r101974  
    1 # Copyright 2009, Google Inc.
     1# Copyright 2009, 2011, Google Inc.
    22# All rights reserved.
    33#
     
    2929
    3030
    31 from mod_pywebsocket import msgutil
    32 
    33 
    34 _GOODBYE_MESSAGE = 'Goodbye'
     31_GOODBYE_MESSAGE = u'Goodbye'
    3532
    3633
     
    4138def web_socket_transfer_data(request):
    4239    while True:
    43         line = msgutil.receive_message(request)
    44         msgutil.send_message(request, line)
    45         if line == _GOODBYE_MESSAGE:
     40        line = request.ws_stream.receive_message()
     41        if line is None:
    4642            return
     43        if isinstance(line, unicode):
     44            request.ws_stream.send_message(line, binary=False)
     45            if line == _GOODBYE_MESSAGE:
     46                return
     47        else:
     48            request.ws_stream.send_message(line, binary=True)
Note: See TracChangeset for help on using the changeset viewer.