tyoshino@chromium.org [Fri, 31 May 2013 05:50:51 +0000 (05:50 +0000)]
Move logging code to util.js
R=yhirano@chromium.org
Review URL: https://codereview.appspot.com/9711045
git-svn-id: https://pywebsocket.googlecode.com/svn/trunk/src@769
4ff78f4a-9131-11de-b045-
6380ec9940d4
tyoshino@chromium.org [Thu, 30 May 2013 03:13:16 +0000 (03:13 +0000)]
Make eventsource.html report more info
- Show note about --cgi_path parameter
- Print onopen and onerror event
- Add id to the stream
R=ricea@chromium.org
Review URL: https://codereview.appspot.com/9788045
git-svn-id: https://pywebsocket.googlecode.com/svn/trunk/src@768
4ff78f4a-9131-11de-b045-
6380ec9940d4
tyoshino@chromium.org [Wed, 1 May 2013 10:20:08 +0000 (10:20 +0000)]
[echo_client] Exit when an extension is enabled and an old protocol which does not support extensions is specified
Release note: Exit echo_client when an extension is enabled and an old protocol is specified.
Review URL: https://codereview.appspot.com/9072043
git-svn-id: https://pywebsocket.googlecode.com/svn/trunk/src@767
4ff78f4a-9131-11de-b045-
6380ec9940d4
tyoshino@chromium.org [Wed, 1 May 2013 03:17:18 +0000 (03:17 +0000)]
Remove unnecessary line configuring server's stderr. test_version_check.
pywebsocket server doesn't output anything annoying for this test case.
Release note: n/a
Review URL: https://codereview.appspot.com/8955043
git-svn-id: https://pywebsocket.googlecode.com/svn/trunk/src@766
4ff78f4a-9131-11de-b045-
6380ec9940d4
tyoshino@chromium.org [Tue, 30 Apr 2013 08:17:35 +0000 (08:17 +0000)]
Add instruction how to configure WebSocket extensions to pydoc.
Release note: mod_pywebsocket directory pydoc update. Added note about extension configuration
Review URL: https://codereview.appspot.com/8954043
git-svn-id: https://pywebsocket.googlecode.com/svn/trunk/src@765
4ff78f4a-9131-11de-b045-
6380ec9940d4
tyoshino@chromium.org [Thu, 25 Apr 2013 14:12:16 +0000 (14:12 +0000)]
Add permessage-deflate support to echo_client.py
Release note: Add permessage-deflate support to echo_client.py
Review URL: https://codereview.appspot.com/8906043
git-svn-id: https://pywebsocket.googlecode.com/svn/trunk/src@764
4ff78f4a-9131-11de-b045-
6380ec9940d4
yhirano@chromium.org [Wed, 24 Apr 2013 01:16:26 +0000 (01:16 +0000)]
c2s_max_window_bits parameter for a client can be configured only if the client allows it.
Review URL: https://codereview.appspot.com/8911046
git-svn-id: https://pywebsocket.googlecode.com/svn/trunk/src@763
4ff78f4a-9131-11de-b045-
6380ec9940d4
tyoshino@chromium.org [Mon, 22 Apr 2013 09:04:48 +0000 (09:04 +0000)]
Add tests on the extension processor registry
Release note: n/a (test only change)
Review URL: https://codereview.appspot.com/8782045
git-svn-id: https://pywebsocket.googlecode.com/svn/trunk/src@762
4ff78f4a-9131-11de-b045-
6380ec9940d4
tyoshino@chromium.org [Mon, 22 Apr 2013 07:41:12 +0000 (07:41 +0000)]
Define a constant for sleep time for warming up the server.
Release note: n/a (test only change)
Review URL: https://codereview.appspot.com/8782044
git-svn-id: https://pywebsocket.googlecode.com/svn/trunk/src@761
4ff78f4a-9131-11de-b045-
6380ec9940d4
yhirano@chromium.org [Mon, 22 Apr 2013 04:38:52 +0000 (04:38 +0000)]
Restore x-webkit-deflate-frame extension removed at r751.
The extension needs to be implemented for testing the blink implementation.
Review URL: https://codereview.appspot.com/8902045
git-svn-id: https://pywebsocket.googlecode.com/svn/trunk/src@760
4ff78f4a-9131-11de-b045-
6380ec9940d4
tyoshino@chromium.org [Fri, 19 Apr 2013 04:30:15 +0000 (04:30 +0000)]
Add tests for permessage-deflate in test_msgutil.py.
Since the existing tests for permessage-compress covers most of code path
used for permessage-deflate, I don't add the same ones, but just these simple
two cases.
Release note: n/a (test only change)
Review URL: https://codereview.appspot.com/8541048
git-svn-id: https://pywebsocket.googlecode.com/svn/trunk/src@759
4ff78f4a-9131-11de-b045-
6380ec9940d4
tyoshino@chromium.org [Thu, 18 Apr 2013 02:07:28 +0000 (02:07 +0000)]
Shorten test method names where it's clear which protocol is tested.
Review URL: https://codereview.appspot.com/8540047
git-svn-id: https://pywebsocket.googlecode.com/svn/trunk/src@757
4ff78f4a-9131-11de-b045-
6380ec9940d4
tyoshino@chromium.org [Wed, 17 Apr 2013 03:28:35 +0000 (03:28 +0000)]
Print time, filename and line number like google-glog to ease debugging rather than printing class name.
Review URL: https://codereview.appspot.com/8534046
git-svn-id: https://pywebsocket.googlecode.com/svn/trunk/src@756
4ff78f4a-9131-11de-b045-
6380ec9940d4
tyoshino@chromium.org [Tue, 16 Apr 2013 11:13:04 +0000 (11:13 +0000)]
Split EndToEndTest into smaller classes
After this, I'm going to shorten test methods.
Release note: n/a (test only change)
Review URL: https://codereview.appspot.com/8792043
git-svn-id: https://pywebsocket.googlecode.com/svn/trunk/src@755
4ff78f4a-9131-11de-b045-
6380ec9940d4
tyoshino@chromium.org [Tue, 16 Apr 2013 08:42:50 +0000 (08:42 +0000)]
Add permessage-deflate tests on two-message cases.
Review URL: https://codereview.appspot.com/8537044
git-svn-id: https://pywebsocket.googlecode.com/svn/trunk/src@754
4ff78f4a-9131-11de-b045-
6380ec9940d4
tyoshino@chromium.org [Tue, 16 Apr 2013 07:22:25 +0000 (07:22 +0000)]
Rename extension processor classes to match extension identifier.
Bonus: Remove commented out x-webkit prefixed extension registration code
which now are never going to live.
Review URL: https://codereview.appspot.com/8576046
git-svn-id: https://pywebsocket.googlecode.com/svn/trunk/src@753
4ff78f4a-9131-11de-b045-
6380ec9940d4
tyoshino@chromium.org [Tue, 16 Apr 2013 05:52:56 +0000 (05:52 +0000)]
Add permessage-deflate support.
Review URL: https://codereview.appspot.com/8666044
git-svn-id: https://pywebsocket.googlecode.com/svn/trunk/src@752
4ff78f4a-9131-11de-b045-
6380ec9940d4
tyoshino@chromium.org [Mon, 15 Apr 2013 05:40:49 +0000 (05:40 +0000)]
Fix extension parameter parsing code of deflate extensions.
They were not passing parsed integer value to deflate/inflate classes.
Release note: Fix broken extension parameter parsing code of perframe-deflate,
x-webkit-perframe-deflate, permessage-compression and
x-permessage-compression.
Review URL: https://codereview.appspot.com/8589046
git-svn-id: https://pywebsocket.googlecode.com/svn/trunk/src@751
4ff78f4a-9131-11de-b045-
6380ec9940d4
tyoshino@chromium.org [Thu, 11 Apr 2013 08:17:49 +0000 (08:17 +0000)]
Factor out framing part of deflate method of permessage-compress extension into a separate class.
It's going to be used for permessage-deflate implementation.
Release note: n/a (no behavior change)
Review URL: https://codereview.appspot.com/8411044
git-svn-id: https://pywebsocket.googlecode.com/svn/trunk/src@750
4ff78f4a-9131-11de-b045-
6380ec9940d4
tyoshino@chromium.org [Thu, 11 Apr 2013 07:18:51 +0000 (07:18 +0000)]
Add note about methods for setting c2s parameter.
c2s methods are just for negotiation testing.
Release note: n/a (comment only)
BUG=none
TEST=run_all.py
Review URL: https://codereview.appspot.com/8589045
git-svn-id: https://pywebsocket.googlecode.com/svn/trunk/src@749
4ff78f4a-9131-11de-b045-
6380ec9940d4
tyoshino@chromium.org [Mon, 8 Apr 2013 14:04:48 +0000 (14:04 +0000)]
Factor out part of compression stats calculation code into a separate class.
Release note: n/a (no behavior change)
Review URL: https://codereview.appspot.com/8411043
git-svn-id: https://pywebsocket.googlecode.com/svn/trunk/src@748
4ff78f4a-9131-11de-b045-
6380ec9940d4
tyoshino@chromium.org [Mon, 8 Apr 2013 10:11:54 +0000 (10:11 +0000)]
Make window bits parameter validation stricter.
Unittests are also added.
Release note: LZ77 window bits related extension parameter with leading zeroes will be rejected.
Review URL: https://codereview.appspot.com/8347044
git-svn-id: https://pywebsocket.googlecode.com/svn/trunk/src@747
4ff78f4a-9131-11de-b045-
6380ec9940d4
tyoshino@chromium.org [Mon, 8 Apr 2013 04:41:10 +0000 (04:41 +0000)]
[Bug fix] Do zero check on the value to be a denominator in incoming DEFLATE ratio calculation.
Release note: same as CL title
Review URL: https://codereview.appspot.com/8408043
git-svn-id: https://pywebsocket.googlecode.com/svn/trunk/src@746
4ff78f4a-9131-11de-b045-
6380ec9940d4
tyoshino@chromium.org [Fri, 5 Apr 2013 11:30:09 +0000 (11:30 +0000)]
Give more descriptive name for _deflater and _inflater (prefix _rfc1979)
Review URL: https://codereview.appspot.com/8401046
git-svn-id: https://pywebsocket.googlecode.com/svn/trunk/src@745
4ff78f4a-9131-11de-b045-
6380ec9940d4
tyoshino@chromium.org [Thu, 4 Apr 2013 09:27:11 +0000 (09:27 +0000)]
Stop deflate-stream support.
Buffer draining code that was required to close deflate-stream enabled
session cleanly will be also removed.
Review URL: https://codereview.appspot.com/8358043
git-svn-id: https://pywebsocket.googlecode.com/svn/trunk/src@744
4ff78f4a-9131-11de-b045-
6380ec9940d4
tyoshino@chromium.org [Mon, 18 Mar 2013 14:14:59 +0000 (14:14 +0000)]
Update version 0.7.8 -> 0.7.9
Bonus: remove the URL of RFC 6455 from description. It's too long.
Review URL: https://codereview.appspot.com/7690045
git-svn-id: https://pywebsocket.googlecode.com/svn/trunk/src@742
4ff78f4a-9131-11de-b045-
6380ec9940d4
tyoshino@chromium.org [Mon, 18 Mar 2013 06:25:01 +0000 (06:25 +0000)]
Use unparsed_uri to build Sec-WebSocket-Location header.
Release note: Changed Sec-WebSocket-Location to include the query part.
BUG= https://code.google.com/p/pywebsocket/issues/detail?id=68
Review URL: https://codereview.appspot.com/7568046
git-svn-id: https://pywebsocket.googlecode.com/svn/trunk/src@741
4ff78f4a-9131-11de-b045-
6380ec9940d4
tyoshino@chromium.org [Fri, 15 Mar 2013 12:31:15 +0000 (12:31 +0000)]
Move out the code for the deflate-stream extension into a separate file.
Release note: DeflateStreamExtensionProcessor moves to deflate_stream_extension.py.
Review URL: https://codereview.appspot.com/7847043
git-svn-id: https://pywebsocket.googlecode.com/svn/trunk/src@740
4ff78f4a-9131-11de-b045-
6380ec9940d4
tyoshino@chromium.org [Fri, 15 Mar 2013 12:29:15 +0000 (12:29 +0000)]
Factor out window bits value validation code into a separate function.
Release note: n/a
Review URL: https://codereview.appspot.com/7643044
git-svn-id: https://pywebsocket.googlecode.com/svn/trunk/src@739
4ff78f4a-9131-11de-b045-
6380ec9940d4
tyoshino@chromium.org [Wed, 13 Mar 2013 09:00:56 +0000 (09:00 +0000)]
Move HyBi 00 specific functions to hybi00.py.
Release note: n/a
Review URL: https://codereview.appspot.com/7645045
git-svn-id: https://pywebsocket.googlecode.com/svn/trunk/src@738
4ff78f4a-9131-11de-b045-
6380ec9940d4
tyoshino@chromium.org [Wed, 13 Mar 2013 02:13:04 +0000 (02:13 +0000)]
Add a simple example of the EventSource API for comparison with WebSocket
Review URL: https://codereview.appspot.com/7569045
git-svn-id: https://pywebsocket.googlecode.com/svn/trunk/src@737
4ff78f4a-9131-11de-b045-
6380ec9940d4
tyoshino@chromium.org [Tue, 12 Mar 2013 08:45:01 +0000 (08:45 +0000)]
Add a benchmark tool for the ArrayBuffer and some refactoring on benchmark.html
Review URL: https://codereview.appspot.com/7516047
git-svn-id: https://pywebsocket.googlecode.com/svn/trunk/src@736
4ff78f4a-9131-11de-b045-
6380ec9940d4
tyoshino@chromium.org [Tue, 12 Mar 2013 04:07:50 +0000 (04:07 +0000)]
Add an option to standalone.py to choose TLS module to use
Review URL: https://codereview.appspot.com/7685045
git-svn-id: https://pywebsocket.googlecode.com/svn/trunk/src@735
4ff78f4a-9131-11de-b045-
6380ec9940d4
tyoshino@chromium.org [Wed, 6 Mar 2013 09:01:05 +0000 (09:01 +0000)]
fast_masking: Remember the last index in masking key
RepeatedXorMasker.mask must use the masking key byte next to one used for the last
mask call. Make fast_masking library take masking index and _mask_using_swig method
update self._masking_key_index.
Also, this CL fixes unittest for util.py. It was using three byte data as
masking keys for testing. Masking keys are always 4 byte and fast_masking cannot
handle such a mask.
Review URL: https://codereview.appspot.com/7480045
git-svn-id: https://pywebsocket.googlecode.com/svn/trunk/src@734
4ff78f4a-9131-11de-b045-
6380ec9940d4
tyoshino@chromium.org [Wed, 6 Mar 2013 07:09:42 +0000 (07:09 +0000)]
Wrap socket._fileobject instances made from OpenSSL.SSL.Connection instances for some tweak.
The Connection instances raise special exceptions. We need to catch and
convert/dismiss them to meet the expectation of SocketServer.
Review URL: https://codereview.appspot.com/7365051
git-svn-id: https://pywebsocket.googlecode.com/svn/trunk/src@733
4ff78f4a-9131-11de-b045-
6380ec9940d4
tyoshino@chromium.org [Tue, 5 Mar 2013 06:35:52 +0000 (06:35 +0000)]
Change benchmark tool to measure performance for each direction.
Review URL: https://codereview.appspot.com/7303084
git-svn-id: https://pywebsocket.googlecode.com/svn/trunk/src@731
4ff78f4a-9131-11de-b045-
6380ec9940d4
tyoshino@chromium.org [Tue, 5 Mar 2013 06:30:44 +0000 (06:30 +0000)]
Override shutdown method on _StandaloneSSLConnection object to strip "how" argument.
Normal socket has "how" argument but OpenSSL.SSL.Connection doesn't. To avoid
an error, insert a function to remove the argument.
Bonus:
Quit if --tls-client-auth is specified but ssl module is not available.
We log that at critical level now but forgot to exit.
Review URL: https://codereview.appspot.com/7374048
git-svn-id: https://pywebsocket.googlecode.com/svn/trunk/src@730
4ff78f4a-9131-11de-b045-
6380ec9940d4
tyoshino@chromium.org [Tue, 5 Mar 2013 05:25:25 +0000 (05:25 +0000)]
Add C++ based faster masking library.
Making key related variables in util.py are renamed to less confusing names.
Review URL: https://codereview.appspot.com/7306103
git-svn-id: https://pywebsocket.googlecode.com/svn/trunk/src@729
4ff78f4a-9131-11de-b045-
6380ec9940d4
toyoshim@chromium.org [Mon, 4 Mar 2013 11:17:17 +0000 (11:17 +0000)]
TLS optional client cert support
Currently pywebsocket support client cert auth, but it is only mandatory case.
Chromium implement optional case and this change is required to confirm its
implementation.
BUG=crbug.com/177606
Review URL: https://codereview.appspot.com/7461047
git-svn-id: https://pywebsocket.googlecode.com/svn/trunk/src@728
4ff78f4a-9131-11de-b045-
6380ec9940d4
tyoshino@chromium.org [Fri, 22 Feb 2013 08:11:07 +0000 (08:11 +0000)]
Print cipher in use.
Review URL: https://codereview.appspot.com/7376048
git-svn-id: https://pywebsocket.googlecode.com/svn/trunk/src@727
4ff78f4a-9131-11de-b045-
6380ec9940d4
tyoshino@chromium.org [Tue, 19 Feb 2013 08:40:03 +0000 (08:40 +0000)]
Stop using bytes which is built-in type name.
Review URL: https://codereview.appspot.com/7311095
git-svn-id: https://pywebsocket.googlecode.com/svn/trunk/src@726
4ff78f4a-9131-11de-b045-
6380ec9940d4
tyoshino@chromium.org [Wed, 6 Feb 2013 16:44:58 +0000 (16:44 +0000)]
Simple benchmark page.
Review URL: https://codereview.appspot.com/7309044
git-svn-id: https://pywebsocket.googlecode.com/svn/trunk/src@725
4ff78f4a-9131-11de-b045-
6380ec9940d4
tyoshino@chromium.org [Tue, 5 Feb 2013 05:21:10 +0000 (05:21 +0000)]
Add a handler which rejects all extensions.
Review URL: https://codereview.appspot.com/7015043
git-svn-id: https://pywebsocket.googlecode.com/svn/trunk/src@723
4ff78f4a-9131-11de-b045-
6380ec9940d4
tyoshino@chromium.org [Mon, 4 Feb 2013 08:31:33 +0000 (08:31 +0000)]
Rename variables named bytes which is built-in type name of Python.
Review URL: https://codereview.appspot.com/7203060
git-svn-id: https://pywebsocket.googlecode.com/svn/trunk/src@722
4ff78f4a-9131-11de-b045-
6380ec9940d4
tyoshino@chromium.org [Mon, 4 Feb 2013 08:04:22 +0000 (08:04 +0000)]
Add an option to disable SSL compression.
Review URL: https://codereview.appspot.com/7194054
git-svn-id: https://pywebsocket.googlecode.com/svn/trunk/src@721
4ff78f4a-9131-11de-b045-
6380ec9940d4
tyoshino@chromium.org [Fri, 1 Feb 2013 06:57:36 +0000 (06:57 +0000)]
Add extra_headers attribute to request object to allow users to append their
own headers to the WebSocket handshake.
BUG= http://code.google.com/p/pywebsocket/issues/detail?id=127
Review URL: https://codereview.appspot.com/7197056
git-svn-id: https://pywebsocket.googlecode.com/svn/trunk/src@720
4ff78f4a-9131-11de-b045-
6380ec9940d4
tyoshino@chromium.org [Fri, 25 Jan 2013 05:58:07 +0000 (05:58 +0000)]
Add subprotocol box.
Review URL: https://codereview.appspot.com/7017043
git-svn-id: https://pywebsocket.googlecode.com/svn/trunk/src@719
4ff78f4a-9131-11de-b045-
6380ec9940d4
tyoshino@chromium.org [Wed, 28 Nov 2012 14:16:09 +0000 (14:16 +0000)]
Fix log text written assuming Stream is used only by server.
It's used by echo_client.py too.
Review URL: https://codereview.appspot.com/6855111
git-svn-id: https://pywebsocket.googlecode.com/svn/trunk/src@718
4ff78f4a-9131-11de-b045-
6380ec9940d4
tyoshino@chromium.org [Wed, 28 Nov 2012 14:15:33 +0000 (14:15 +0000)]
Add getpeername to TLSSocket.
Review URL: https://codereview.appspot.com/6856109
git-svn-id: https://pywebsocket.googlecode.com/svn/trunk/src@717
4ff78f4a-9131-11de-b045-
6380ec9940d4
tyoshino@chromium.org [Wed, 28 Nov 2012 14:14:56 +0000 (14:14 +0000)]
Print cipher in use.
Bonus: remove do_handshake call for ssl module. it's done on wrap_socket call.
Review URL: https://codereview.appspot.com/6842110
git-svn-id: https://pywebsocket.googlecode.com/svn/trunk/src@716
4ff78f4a-9131-11de-b045-
6380ec9940d4
bashi@chromium.org [Wed, 28 Nov 2012 09:06:31 +0000 (09:06 +0000)]
[mux] Support drop code 3009
Raise LogicalChannelError when a bad fragmented inner frame is detected.
Review URL: https://codereview.appspot.com/6854059
git-svn-id: https://pywebsocket.googlecode.com/svn/trunk/src@715
4ff78f4a-9131-11de-b045-
6380ec9940d4
bashi@chromium.org [Fri, 16 Nov 2012 01:09:39 +0000 (01:09 +0000)]
[mux] Extension support for logical channel
- Set StreamOptions to logical channel.
- Pass mux_handler.extensiosn() to HandshakeDeltaBase when creating
implicit opend connection.
Review URL: https://codereview.appspot.com/6849056
git-svn-id: https://pywebsocket.googlecode.com/svn/trunk/src@714
4ff78f4a-9131-11de-b045-
6380ec9940d4
bashi@chromium.org [Thu, 15 Nov 2012 04:22:44 +0000 (04:22 +0000)]
[mux] Use physical_connection.send_message() to send logical message
_PhysicalConnectionWriter should use physical_stream.send_message()
instead of physical_connection.write() so that frame filters and
message filters of the physical connection are applied.
- Added a flag to Stream.close_connection(). This flag is True when the
caller want to wait the response. _PhysicalConnectionWriter sets this
flag to False to suppress calling receive_message() in
close_connection() because the reader thread will receive the response
(if any).
- Changed helper functions (e.g. _create_add_channel_response) not to
enclose a logical frame into a physical frame.
physical_connection.send_message() will wrap a logical message in a
physical frame.
- Send close message when the writer thread finishes.
- _LogicalStream._write_inner_frame() no longer wraps a logical (inner)
frame into a physical frame, too.
- Changed _LogicalStream._create_inner_frame() to apply frame filters to
a logical frame.
- Changed _LogicalStream.send_message() to apply message filters to
a logical message.
Review URL: https://codereview.appspot.com/6850048
git-svn-id: https://pywebsocket.googlecode.com/svn/trunk/src@713
4ff78f4a-9131-11de-b045-
6380ec9940d4
tyoshino@chromium.org [Mon, 12 Nov 2012 05:35:00 +0000 (05:35 +0000)]
Add TLS version flag to echo_client.py
socket.ssl doesn't accept version parameter.
As a bonus,
- add a log printing which TLS module is used to standalone.py
- Rename _ssl to _tls_socket for readability.
- _TLSSocket doesn't have sendall() method. Implement it.
- call ssl.SSLSocket's close() when _TLSSocket.close() is called
- add comment about how ssl module behaves when key/cert parameters are bad
Review URL: https://codereview.appspot.com/6819112
git-svn-id: https://pywebsocket.googlecode.com/svn/trunk/src@712
4ff78f4a-9131-11de-b045-
6380ec9940d4
bashi@chromium.org [Fri, 9 Nov 2012 01:06:45 +0000 (01:06 +0000)]
Fix logical frame fragmentation handling
- Add _InnerMessageBuilder. This class assembles fragmented logical
frames and builds an inner (logical) message.
- Override _get_message_from_frame() in _LogicalStream. Use
_InnerMessageBuilder to build an inner message.
- Remove StreamOptions.allow_fragmented_control_frame. This option
is no longer needed.
Review URL: https://codereview.appspot.com/6820108
git-svn-id: https://pywebsocket.googlecode.com/svn/trunk/src@711
4ff78f4a-9131-11de-b045-
6380ec9940d4
tyoshino@chromium.org [Mon, 5 Nov 2012 11:28:47 +0000 (11:28 +0000)]
Fix worker stopper.
- Fix a bug in notify_writer_done
- Add a mock connection that throws an exception on write
- Add a test that checks if notify_writer_done is really called
Review URL: https://codereview.appspot.com/6814082
git-svn-id: https://pywebsocket.googlecode.com/svn/trunk/src@710
4ff78f4a-9131-11de-b045-
6380ec9940d4
tyoshino@chromium.org [Mon, 5 Nov 2012 11:05:06 +0000 (11:05 +0000)]
Log exceptions occur during set_read_state and on_writer_done.
Review URL: https://codereview.appspot.com/6815079
git-svn-id: https://pywebsocket.googlecode.com/svn/trunk/src@709
4ff78f4a-9131-11de-b045-
6380ec9940d4
tyoshino@chromium.org [Mon, 5 Nov 2012 11:03:59 +0000 (11:03 +0000)]
Send a close with the internal endpoint error status code when BadOperationException is thrown.
Review URL: https://codereview.appspot.com/6822079
git-svn-id: https://pywebsocket.googlecode.com/svn/trunk/src@708
4ff78f4a-9131-11de-b045-
6380ec9940d4
tyoshino@chromium.org [Mon, 5 Nov 2012 10:59:27 +0000 (10:59 +0000)]
Print special messages when received a Blob or an ArrayBuffer.
Review URL: https://codereview.appspot.com/6811078
git-svn-id: https://pywebsocket.googlecode.com/svn/trunk/src@707
4ff78f4a-9131-11de-b045-
6380ec9940d4
tyoshino@chromium.org [Mon, 5 Nov 2012 10:58:24 +0000 (10:58 +0000)]
Group tests based on what extension is used.
Review URL: https://codereview.appspot.com/6822080
git-svn-id: https://pywebsocket.googlecode.com/svn/trunk/src@706
4ff78f4a-9131-11de-b045-
6380ec9940d4
tyoshino@chromium.org [Mon, 5 Nov 2012 10:54:27 +0000 (10:54 +0000)]
Style fix.
Review URL: https://codereview.appspot.com/6816087
git-svn-id: https://pywebsocket.googlecode.com/svn/trunk/src@705
4ff78f4a-9131-11de-b045-
6380ec9940d4
bashi@chromium.org [Mon, 5 Nov 2012 08:15:29 +0000 (08:15 +0000)]
Two-pass consistency check for extensions
Before asking the response for each extension processor,
give an opportunity to an extension processor to check the whole list
of requested extensions so that it can disable itself or other
extension processors.
Review URL: https://codereview.appspot.com/6819065
git-svn-id: https://pywebsocket.googlecode.com/svn/trunk/src@704
4ff78f4a-9131-11de-b045-
6380ec9940d4
tyoshino@chromium.org [Mon, 5 Nov 2012 06:13:00 +0000 (06:13 +0000)]
Remove Hixie 75 version protocol support from echo_client.py
Also add warning log to standalone.py
Review URL: https://codereview.appspot.com/6822070
git-svn-id: https://pywebsocket.googlecode.com/svn/trunk/src@703
4ff78f4a-9131-11de-b045-
6380ec9940d4
tyoshino@chromium.org [Mon, 5 Nov 2012 04:32:36 +0000 (04:32 +0000)]
Stop worker threads blocked for send quota shortage when the writer thread is done.
- have _write_inner_frame raise BadOperationException for this case
- rename some callbacks not to have similar method names
Review URL: https://codereview.appspot.com/6814070
git-svn-id: https://pywebsocket.googlecode.com/svn/trunk/src@702
4ff78f4a-9131-11de-b045-
6380ec9940d4
tyoshino@chromium.org [Thu, 1 Nov 2012 08:15:32 +0000 (08:15 +0000)]
Add two simple tests using golden data for permessage deflate
Review URL: https://codereview.appspot.com/6819057
git-svn-id: https://pywebsocket.googlecode.com/svn/trunk/src@701
4ff78f4a-9131-11de-b045-
6380ec9940d4
tyoshino@chromium.org [Thu, 1 Nov 2012 08:09:44 +0000 (08:09 +0000)]
Add randomized tests for the permessage-compress extension.
Review URL: http://codereview.appspot.com/6811051
git-svn-id: https://pywebsocket.googlecode.com/svn/trunk/src@700
4ff78f4a-9131-11de-b045-
6380ec9940d4
bashi@chromium.org [Wed, 31 Oct 2012 09:26:30 +0000 (09:26 +0000)]
[mux] Follow -07 draft (part 1/2)
- Don't exclude 'Connection' header in AddChannel{Request,Response}
- Raise LogicalChannelError when send quota is overflow
- Raise ValueError in _read_number(). Callers of this method should wrap the exception in LogicalChannelError or PhysicalConnectionError
This CL doesn't address extra cost to quota consumption.
Review URL: https://codereview.appspot.com/6734060
git-svn-id: https://pywebsocket.googlecode.com/svn/trunk/src@699
4ff78f4a-9131-11de-b045-
6380ec9940d4
tyoshino@chromium.org [Wed, 31 Oct 2012 04:15:05 +0000 (04:15 +0000)]
Add explanations to log formats and do some cleanup
Review URL: http://codereview.appspot.com/6775075
git-svn-id: https://pywebsocket.googlecode.com/svn/trunk/src@698
4ff78f4a-9131-11de-b045-
6380ec9940d4
tyoshino@chromium.org [Tue, 30 Oct 2012 04:15:39 +0000 (04:15 +0000)]
Make Dispatcher print stack trace when AbortedByUserException is raised
Review URL: http://codereview.appspot.com/6814048
git-svn-id: https://pywebsocket.googlecode.com/svn/trunk/src@697
4ff78f4a-9131-11de-b045-
6380ec9940d4
tyoshino@chromium.org [Tue, 30 Oct 2012 04:10:38 +0000 (04:10 +0000)]
Wrap IOError and socket.error by ConnectionTerminatedException.
As reported here, if IOError and socket.error pass through _stream_base, are converted by Dispatcher, and then becomes annoying long log in headerparserhandler.py and standalone.py
https://groups.google.com/forum/?hl=en&fromgroups=#!topic/pywebsocket/_EVWheFrIQY
Differentiating them looks not so meaningful for application. So, just merge them into ConnectionTerminatedException.
Review URL: http://codereview.appspot.com/6814047
git-svn-id: https://pywebsocket.googlecode.com/svn/trunk/src@696
4ff78f4a-9131-11de-b045-
6380ec9940d4
tyoshino@chromium.org [Tue, 30 Oct 2012 04:08:23 +0000 (04:08 +0000)]
Add handler examples for testing AbortedByUserException.
Review URL: http://codereview.appspot.com/6818048
git-svn-id: https://pywebsocket.googlecode.com/svn/trunk/src@695
4ff78f4a-9131-11de-b045-
6380ec9940d4
bashi@chromium.org [Wed, 24 Oct 2012 08:34:26 +0000 (08:34 +0000)]
[mux] Follow -07 draft (part 2/2)
Add per-message extra cost to quota consumption.
Review URL: https://codereview.appspot.com/6709072
git-svn-id: https://pywebsocket.googlecode.com/svn/trunk/src@694
4ff78f4a-9131-11de-b045-
6380ec9940d4
bashi@chromium.org [Mon, 15 Oct 2012 04:56:25 +0000 (04:56 +0000)]
Update version 0.7.7 -> 0.7.8
Review URL: https://codereview.appspot.com/6675048
git-svn-id: https://pywebsocket.googlecode.com/svn/trunk/src@692
4ff78f4a-9131-11de-b045-
6380ec9940d4
bashi@chromium.org [Mon, 15 Oct 2012 04:06:04 +0000 (04:06 +0000)]
[compression] Add bfinal = 1 support
- Add compress_and_finish() method to _Deflater.
- Add 'bfinal' argument to _RFC1979Deflater.filter(). The flag denotes
that deflater should set bfinal to 1.
- Add a setter method which set bfinal to 1 to
DeflateFrameExtensionProcessor and DeflateMessageProcessor.
Review URL: https://codereview.appspot.com/6684050
git-svn-id: https://pywebsocket.googlecode.com/svn/trunk/src@691
4ff78f4a-9131-11de-b045-
6380ec9940d4
bashi@chromium.org [Wed, 10 Oct 2012 06:43:58 +0000 (06:43 +0000)]
Update version 0.7.6 -> 0.7.7
- Documentation
- Drop hixie-75 support
- Bug fixes
Review URL: https://codereview.appspot.com/6633052
git-svn-id: https://pywebsocket.googlecode.com/svn/trunk/src@689
4ff78f4a-9131-11de-b045-
6380ec9940d4
bashi@chromium.org [Wed, 10 Oct 2012 05:59:24 +0000 (05:59 +0000)]
DeflateMessageProcessor should handle fragmented messages
- Rename _compress_outgoing to _compress_outgoin_enabled (to avoid
confusion)
- Add a flag (_compress_ongoing) that denotes whether compression has
started or not.
- Add compress() method to util._Deflater.
- Add 'flush' argument to filter() method of _RFC1979Deflater.
Review URL: https://codereview.appspot.com/6644043
git-svn-id: https://pywebsocket.googlecode.com/svn/trunk/src@687
4ff78f4a-9131-11de-b045-
6380ec9940d4
bashi@chromium.org [Wed, 10 Oct 2012 05:38:01 +0000 (05:38 +0000)]
Add receive_filtered_frame()
A layout test of WebKit (send-file-blob.html) uses
_receive_frame_as_frame_object() private method. Since we have
per message filters as of r655, this private method doesn't always
work as expected. We should provide a public method for tests which
want to examine a frame.
Review URL: https://codereview.appspot.com/6640051
git-svn-id: https://pywebsocket.googlecode.com/svn/trunk/src@686
4ff78f4a-9131-11de-b045-
6380ec9940d4
bashi@chromium.org [Wed, 10 Oct 2012 05:36:38 +0000 (05:36 +0000)]
Add hook function for compression_processor of PerMessageCompressionProcessor
PerMessageCompressionProcessor creates its compression processor based
on the request, so we can't pass parameters of compression processor
in advance. Add a hook so that we can pass parameters to the
compression processor.
This CL also contains a bug fix which was detected by the added test.
Review URL: https://codereview.appspot.com/6636047
git-svn-id: https://pywebsocket.googlecode.com/svn/trunk/src@685
4ff78f4a-9131-11de-b045-
6380ec9940d4
tyoshino@chromium.org [Wed, 10 Oct 2012 04:54:48 +0000 (04:54 +0000)]
Fix typo in comment. perframe -> permessage
Review URL: http://codereview.appspot.com/6643055
git-svn-id: https://pywebsocket.googlecode.com/svn/trunk/src@684
4ff78f4a-9131-11de-b045-
6380ec9940d4
tyoshino@chromium.org [Wed, 10 Oct 2012 04:53:43 +0000 (04:53 +0000)]
Use common components defined by test_handshake_hybi.py in test_handshake_hybi08.py
Review URL: http://codereview.appspot.com/6625045
git-svn-id: https://pywebsocket.googlecode.com/svn/trunk/src@683
4ff78f4a-9131-11de-b045-
6380ec9940d4
bashi@chromium.org [Tue, 9 Oct 2012 06:01:53 +0000 (06:01 +0000)]
Add x-webkit-permessage-compress for WebKit LayoutTests
Review URL: https://codereview.appspot.com/6621051
git-svn-id: https://pywebsocket.googlecode.com/svn/trunk/src@682
4ff78f4a-9131-11de-b045-
6380ec9940d4
tyoshino@chromium.org [Fri, 5 Oct 2012 06:32:19 +0000 (06:32 +0000)]
Mark allow_draft75 option obsolete in headerparserhandler.py
Review URL: http://codereview.appspot.com/6612052
git-svn-id: https://pywebsocket.googlecode.com/svn/trunk/src@681
4ff78f4a-9131-11de-b045-
6380ec9940d4
tyoshino@chromium.org [Fri, 5 Oct 2012 06:31:47 +0000 (06:31 +0000)]
Remove texts about Hixie 75 version protocol support
Bonus: follow PEP 287 (http://www.python.org/dev/peps/pep-0287/)
Review URL: http://codereview.appspot.com/6612051
git-svn-id: https://pywebsocket.googlecode.com/svn/trunk/src@680
4ff78f4a-9131-11de-b045-
6380ec9940d4
tyoshino@chromium.org [Fri, 5 Oct 2012 06:31:35 +0000 (06:31 +0000)]
Add Hixie 75 spec address.
Review URL: http://codereview.appspot.com/6613051
git-svn-id: https://pywebsocket.googlecode.com/svn/trunk/src@679
4ff78f4a-9131-11de-b045-
6380ec9940d4
bashi@chromium.org [Fri, 5 Oct 2012 05:22:52 +0000 (05:22 +0000)]
[mux] Fix expectation of MuxTest.test_parse_request_text
len(header) should be 2.
Review URL: https://codereview.appspot.com/6585064
git-svn-id: https://pywebsocket.googlecode.com/svn/trunk/src@678
4ff78f4a-9131-11de-b045-
6380ec9940d4
tyoshino@chromium.org [Fri, 5 Oct 2012 05:02:49 +0000 (05:02 +0000)]
Add code for testing fragmentation in send_message in _stream_hybi.py
Review URL: http://codereview.appspot.com/6601057
git-svn-id: https://pywebsocket.googlecode.com/svn/trunk/src@676
4ff78f4a-9131-11de-b045-
6380ec9940d4
tyoshino@chromium.org [Fri, 5 Oct 2012 01:37:06 +0000 (01:37 +0000)]
Remove code for Hixie75 version protocol support
- Remove handshake processor for Hixie75
- Remove tests for Hixie75
Bonus
- Print method if it's not GET
- Add code to check HTTP version
- Fail handshake when the Sec-WebSocket-Protocol header coming from client is empty
- Port tests for Hixie75 that make sense for RFC 6455 but wasn't ported
Review URL: http://codereview.appspot.com/6587079
git-svn-id: https://pywebsocket.googlecode.com/svn/trunk/src@674
4ff78f4a-9131-11de-b045-
6380ec9940d4
tyoshino@chromium.org [Wed, 3 Oct 2012 09:25:20 +0000 (09:25 +0000)]
Fixing an extension processor setup bug
- Fix extension processor initialization for permessage-compress
- Add spec names to extension definitions
- Add tests checking if hybi.py is setting up extension processors correctly
- return None explicitly in _lookup_compression_processor method
- Rename PerFrameCompressionExtensionTest to one reflecting what's tested more
Review URL: http://codereview.appspot.com/6592062
git-svn-id: https://pywebsocket.googlecode.com/svn/trunk/src@673
4ff78f4a-9131-11de-b045-
6380ec9940d4
bashi@chromium.org [Tue, 2 Oct 2012 22:45:14 +0000 (22:45 +0000)]
[mux] Remove unnecessary headers from AddChannelRequest/Response
- AddChannelRequest
Upgrade, Connection, Sec-WebSocket-Version and Sec-WebSocket-Key should
be excluded.
- AddChannelResponse
Upgrade, Connection and Sec-WebSocket-Accept should be excluded.
Review URL: https://codereview.appspot.com/6575061
git-svn-id: https://pywebsocket.googlecode.com/svn/trunk/src@672
4ff78f4a-9131-11de-b045-
6380ec9940d4
bashi@chromium.org [Thu, 27 Sep 2012 01:53:37 +0000 (01:53 +0000)]
[mux] Support delta encoding in AddChannelRequest
Implement delta encoding.
Review URL: https://codereview.appspot.com/6544049
git-svn-id: https://pywebsocket.googlecode.com/svn/trunk/src@671
4ff78f4a-9131-11de-b045-
6380ec9940d4
bashi@chromium.org [Fri, 21 Sep 2012 08:30:42 +0000 (08:30 +0000)]
[mux] Fix _encode_number() in mux_client_for_testing.py
The msb of the first byte of number field should be zero as of -05
draft.
Review URL: https://codereview.appspot.com/6554055
git-svn-id: https://pywebsocket.googlecode.com/svn/trunk/src@668
4ff78f4a-9131-11de-b045-
6380ec9940d4
bashi@chromium.org [Fri, 21 Sep 2012 04:18:10 +0000 (04:18 +0000)]
Rename STATUS_INTERNAL_SERVER_ERROR
Status code 1011 can be sent from not only a server but also a client.
http://www.rfc-editor.org/errata_search.php?rfc=6455
Review URL: https://codereview.appspot.com/6554052
git-svn-id: https://pywebsocket.googlecode.com/svn/trunk/src@667
4ff78f4a-9131-11de-b045-
6380ec9940d4
bashi@chromium.org [Thu, 20 Sep 2012 06:32:55 +0000 (06:32 +0000)]
[mux] Drop code support
- Add PhysicalConnectionError and LogicalChannelError exception classes.
They are throwed when the server must fail physical connection or
logical channel respectively.
- Throw above exceptions to conform the latest spec (not published yet,
though). This CL doesn't cover all errors. Remaining errors will
cover following CLs.
TEST=test/test_mux.py
Review URL: https://codereview.appspot.com/6498129
git-svn-id: https://pywebsocket.googlecode.com/svn/trunk/src@666
4ff78f4a-9131-11de-b045-
6380ec9940d4
bashi@chromium.org [Wed, 19 Sep 2012 11:37:04 +0000 (11:37 +0000)]
[mux] Remove TODOs from number decoding
Raise exceptions when (1) the msb of the first byte isn't 0, and (2) the
encoding is redundant.
TEST=test/test_mux.py
Review URL: https://codereview.appspot.com/6495127
git-svn-id: https://pywebsocket.googlecode.com/svn/trunk/src@665
4ff78f4a-9131-11de-b045-
6380ec9940d4
bashi@chromium.org [Wed, 12 Sep 2012 07:57:07 +0000 (07:57 +0000)]
Follow -05 draft spec.
The CL isn't exhaustive. Only updates the current implementation.
- Updated _MuxFramePayloadParser and helper functions to
follow the current draft spec.
- Added some TODO comments.
- Updated unit tests and EtoE tests.
TEST=test/test_mux.py
BUG=none
Review URL: https://codereview.appspot.com/6489094
git-svn-id: https://pywebsocket.googlecode.com/svn/trunk/src@664
4ff78f4a-9131-11de-b045-
6380ec9940d4
tyoshino@chromium.org [Tue, 4 Sep 2012 10:26:36 +0000 (10:26 +0000)]
Add warning comment to _main function for people who want to use the function
from their own code about its side-effects.
Review URL: http://codereview.appspot.com/6490073
git-svn-id: https://pywebsocket.googlecode.com/svn/trunk/src@663
4ff78f4a-9131-11de-b045-
6380ec9940d4
toyoshim@chromium.org [Tue, 28 Aug 2012 11:25:13 +0000 (11:25 +0000)]
Take care of port 0
If user specify port 0, the operating system assigned a free port.
This port number should be shown as a log, and must be shared with
other interfaces if user wants to listen at multiple ports.
Also self.server_port should be updated to be refered by external code.
Review URL: https://codereview.appspot.com/6491043
git-svn-id: https://pywebsocket.googlecode.com/svn/trunk/src@662
4ff78f4a-9131-11de-b045-
6380ec9940d4
toyoshim@chromium.org [Tue, 28 Aug 2012 05:44:24 +0000 (05:44 +0000)]
Prepare dispatcher inside of WebSocketServer
User may use WebSocketServer directly. So having dispatcher preparation
code inside of WebSocketServer makes it easier.
Review URL: https://codereview.appspot.com/6480070
git-svn-id: https://pywebsocket.googlecode.com/svn/trunk/src@661
4ff78f4a-9131-11de-b045-
6380ec9940d4
tyoshino@chromium.org [Mon, 27 Aug 2012 05:09:21 +0000 (05:09 +0000)]
Add instruction to run standalone server to README and one to run simple demo
to standalone.py's pydoc.
BUG= http://code.google.com/p/pywebsocket/issues/detail?id=124
TEST=none
Review URL: http://codereview.appspot.com/6483053
git-svn-id: https://pywebsocket.googlecode.com/svn/trunk/src@660
4ff78f4a-9131-11de-b045-
6380ec9940d4
tyoshino@chromium.org [Fri, 24 Aug 2012 17:21:55 +0000 (17:21 +0000)]
Show critical log when no socket is available.
BUG= http://code.google.com/p/pywebsocket/issues/detail?id=117
TEST=none
Review URL: http://codereview.appspot.com/6482063
git-svn-id: https://pywebsocket.googlecode.com/svn/trunk/src@659
4ff78f4a-9131-11de-b045-
6380ec9940d4