Bug 32097

Summary: mod_pywebsocket IndexError: string index out of range
Product: WebKit Reporter: Alexey Proskuryakov <ap>
Component: Tools / TestsAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, ukai, webkit.review.bot, yuzo
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Mac (Intel)   
OS: OS X 10.5   
Attachments:
Description Flags
test case
none
Update pywebsocket to 0.4.3
none
Add run-webkit-websocketserver none

Description Alexey Proskuryakov 2009-12-02 17:20:12 PST
Created attachment 44196 [details]
test case

Running the attached test result in a PASS in browser, but there is an exception in server, which doesn't seem right:

[2009-12-02 17:17:55,436] [WARNING] root: mod_pywebsocket: web_socket_transfer_data raised exception: Traceback (most recent call last):
  File "/Users/ap/Safari/OpenSource/WebKitTools/pywebsocket/mod_pywebsocket/dispatch.py", line 179, in transfer_data
    transfer_data_(request)
  File "<string>", line 43, in web_socket_transfer_data
  File "/Users/ap/Safari/OpenSource/WebKitTools/pywebsocket/mod_pywebsocket/msgutil.py", line 67, in receive_message
    frame_type = ord(frame_type_str[0])
IndexError: string index out of range
Comment 1 Alexey Proskuryakov 2009-12-02 17:21:00 PST
To run the test, please copy echo_wsh.py from pywebsocket examples to LayoutTests/websocket/tests.
Comment 2 Yuzo Fujishima 2009-12-02 17:33:43 PST
The browser code doesn't close connection gracefully.

echo_wsh.py won't stop until it receives 'Goodbye'.
Can you try sending it at the end of the test?

Yuzo
Comment 3 Alexey Proskuryakov 2009-12-02 20:14:55 PST
Will try tomorrow, thanks!

But is "string index out of range" an appropriate error to report in such cases?
Comment 4 Yuzo Fujishima 2009-12-03 01:16:31 PST
I'm preparing a change for better log messages upstream:
http://code.google.com/p/pywebsocket/issues/detail?id=28

I'll file an upgrade patch after the above is committed.

Yuzo
Comment 5 Yuzo Fujishima 2009-12-03 03:13:16 PST
Created attachment 44222 [details]
Update pywebsocket to 0.4.3
Comment 6 WebKit Review Bot 2009-12-03 03:16:56 PST
style-queue ran check-webkit-style on attachment 44222 [details] without any errors.
Comment 7 Eric Seidel (no email) 2009-12-03 13:13:32 PST
Comment on attachment 44222 [details]
Update pywebsocket to 0.4.3

LGTM
Comment 8 WebKit Commit Bot 2009-12-03 14:01:22 PST
Comment on attachment 44222 [details]
Update pywebsocket to 0.4.3

Clearing flags on attachment: 44222

Committed r51661: <http://trac.webkit.org/changeset/51661>
Comment 9 WebKit Commit Bot 2009-12-03 14:01:29 PST
All reviewed patches have been landed.  Closing bug.
Comment 10 Yuzo Fujishima 2009-12-06 21:10:39 PST
Created attachment 44380 [details]
Add run-webkit-websocketserver
Comment 11 WebKit Review Bot 2009-12-06 21:11:00 PST
style-queue ran check-webkit-style on attachment 44380 [details] without any errors.
Comment 12 Yuzo Fujishima 2009-12-06 21:11:58 PST
Addressed the comment.

Can you take another look?

Yuzo
Comment 13 Alexey Proskuryakov 2009-12-06 21:27:19 PST
Looks like the attachment is in a wrong bug.
Comment 14 Yuzo Fujishima 2009-12-06 21:45:19 PST
Comment on attachment 44380 [details]
Add run-webkit-websocketserver

sorry, wrong attachment.