Bug 99282 - [WebSocket] WebSocketInflater should handle BFINAL = 1 blocks
Summary: [WebSocket] WebSocketInflater should handle BFINAL = 1 blocks
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Kenichi Ishibashi
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-10-14 19:28 PDT by Kenichi Ishibashi
Modified: 2012-10-15 18:40 PDT (History)
3 users (show)

See Also:


Attachments
WIP patch (6.41 KB, patch)
2012-10-14 19:37 PDT, Kenichi Ishibashi
no flags Details | Formatted Diff | Diff
Patch (6.49 KB, patch)
2012-10-15 16:44 PDT, Kenichi Ishibashi
no flags Details | Formatted Diff | Diff
Patch (6.41 KB, patch)
2012-10-15 18:07 PDT, Kenichi Ishibashi
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Kenichi Ishibashi 2012-10-14 19:28:07 PDT
We received a bug report from a chromium user (http://code.google.com/p/chromium/issues/detail?id=155060).

The draft specs of deflate-frame and permessage-compress extensions allow an endpoint compress messages as arbitrary number of blocks with BFINAL set to 0 and 1.
http://tools.ietf.org/html/draft-tyoshino-hybi-websocket-perframe-deflate-06#section-4.2.1
http://tools.ietf.org/html/draft-ietf-hybi-permessage-compression-01#section-5.2

WebSocketDeflateFramer doesn't accept blocks with BFINAL set to 1. It should accept such blocks.
Comment 1 Kenichi Ishibashi 2012-10-14 19:37:25 PDT
Created attachment 168613 [details]
WIP patch
Comment 2 Kenichi Ishibashi 2012-10-14 19:38:35 PDT
(In reply to comment #1)
> Created an attachment (id=168613) [details]
> WIP patch

This patch requires a new version of pywebsocket which should include https://codereview.appspot.com/6684050/
Comment 3 Yuta Kitamura 2012-10-14 19:45:38 PDT
Comment on attachment 168613 [details]
WIP patch

View in context: https://bugs.webkit.org/attachment.cgi?id=168613&action=review

> Source/WebCore/Modules/websockets/WebSocketDeflater.cpp:172
> +            // Reveived a block with BFINAL set to 1. Reset decompression state.

Reveived -> Received, maybe?
Comment 4 Kenichi Ishibashi 2012-10-14 19:51:54 PDT
Comment on attachment 168613 [details]
WIP patch

View in context: https://bugs.webkit.org/attachment.cgi?id=168613&action=review

>> Source/WebCore/Modules/websockets/WebSocketDeflater.cpp:172
>> +            // Reveived a block with BFINAL set to 1. Reset decompression state.
> 
> Reveived -> Received, maybe?

Yes. Thank you for the correction. Will fix.
Comment 5 Kenichi Ishibashi 2012-10-15 16:44:19 PDT
Created attachment 168808 [details]
Patch
Comment 6 Kenichi Ishibashi 2012-10-15 16:45:14 PDT
Hi Yuta-san,

pywebsocket has been updated. Could you take another look?
Comment 7 Yuta Kitamura 2012-10-15 17:29:36 PDT
Comment on attachment 168808 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=168808&action=review

Sorry that I didn't catch this in the last review.

> Source/WebCore/Modules/websockets/WebSocketDeflater.cpp:181
> +    return consumedSoFar == length;

In what situation does this function return false? Is there any way to test that?
Comment 8 Kenichi Ishibashi 2012-10-15 18:06:41 PDT
Comment on attachment 168808 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=168808&action=review

>> Source/WebCore/Modules/websockets/WebSocketDeflater.cpp:181
>> +    return consumedSoFar == length;
> 
> In what situation does this function return false? Is there any way to test that?

Sorry, that was a leavings of changes when I investigated the cause. I read zlib.h and confirmed that it shouldn't occur. I will restore it.
Comment 9 Kenichi Ishibashi 2012-10-15 18:07:21 PDT
Created attachment 168828 [details]
Patch
Comment 10 Yuta Kitamura 2012-10-15 18:14:52 PDT
Comment on attachment 168828 [details]
Patch

OK.
Comment 11 Kenichi Ishibashi 2012-10-15 18:16:59 PDT
Comment on attachment 168828 [details]
Patch

Thanks!
Comment 12 WebKit Review Bot 2012-10-15 18:40:47 PDT
Comment on attachment 168828 [details]
Patch

Clearing flags on attachment: 168828

Committed r131395: <http://trac.webkit.org/changeset/131395>
Comment 13 WebKit Review Bot 2012-10-15 18:40:51 PDT
All reviewed patches have been landed.  Closing bug.