Bug 32097 - mod_pywebsocket IndexError: string index out of range
Summary: mod_pywebsocket IndexError: string index out of range
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: 528+ (Nightly build)
Hardware: Macintosh Intel OS X 10.5
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-12-02 17:20 PST by Alexey Proskuryakov
Modified: 2009-12-06 21:45 PST (History)
4 users (show)

See Also:


Attachments
test case (838 bytes, text/html)
2009-12-02 17:20 PST, Alexey Proskuryakov
no flags Details
Update pywebsocket to 0.4.3 (9.15 KB, patch)
2009-12-03 03:13 PST, Yuzo Fujishima
no flags Details | Formatted Diff | Diff
Add run-webkit-websocketserver (4.11 KB, patch)
2009-12-06 21:10 PST, Yuzo Fujishima
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.