Commit Graph
345 Commits
Author SHA1 Message Date
James Coglan d461b0def5 Use symbols for events in the docs. 2015-07-10 21:27:01 +01:00
James Coglan d4245ed3f4 Rather than implementing integer (un)packing ourselves, use the Array#pack and String#unpack methods. 2015-07-10 20:05:19 +01:00
James Coglan 7128d1b030 Standardise the words used to refer to chunks of parser input. 2015-07-10 09:37:03 +01:00
James Coglan 75fe55eaba Adjust how on() calls add_listener(). This is necessary because faye-websocket overrides add_listener with one argument, so users with faye-websocket locked at < 0.10 will see errors. 2015-07-10 09:22:16 +01:00
James Coglan f1fd96e093 Emit an error event *after* setting the ready state to 3. 0.6.0 2015-07-08 20:13:50 +01:00
James Coglan 5764488603 Bump the version to 0.6.0. 2015-07-08 20:08:20 +01:00
James Coglan 8919430801 Add tests for exception safety in the Draft75 parser. 2015-07-07 21:24:33 +01:00
James Coglan fed81a5a88 Small format changes to StreamReader. 2015-07-07 21:24:13 +01:00
James Coglan 91653036ce Parse the mask flag and length in the order they appear in the protocol. 2015-07-07 20:49:29 +01:00
James Coglan e39fa15c07 Revert variable names in Draft75#parse to what they were in 0.5. 2015-07-07 20:45:55 +01:00
James Coglan 50ca31b4c8 Remove empty Driver#shutdown method. 2015-07-07 20:40:53 +01:00
James Coglan 9523937428 Initialize StreamReader in the base constructor. 2015-07-07 20:38:26 +01:00
James Coglan 91df761990 Hybi#shutdown doesn't really need to take a block, it can just take a flag to say whether to emit an error. 2015-07-07 20:33:22 +01:00
James Coglan dcfd35fde8 Remove some excessive whitespace. 2015-07-07 20:32:47 +01:00
James Coglan 587704d752 Test that exceptions are not masked by the parser. 2015-07-07 08:47:08 +01:00
James Coglan 9385764c09 Test that the parser continues working if a message listener raises an error. 2015-07-06 21:19:25 +01:00
James Coglan 582a3b0541 Merge pull request #29 from ioquatix/buffered-input
Use StreamReader for both hybi and draft75.
2015-07-06 20:49:24 +01:00
James Coglan fe6163c336 Perform state changes in #shutdown before calling frame(), which might fail when calling @socket.write. 2015-07-06 20:50:18 +01:00
James Coglan 9b561b6e12 The 'rescue' clause for errors from outgoing extensions should be in #frame, not #send_frame. 2015-07-06 20:48:44 +01:00
Samuel Williams 425e15da83 Use StreamReader for both hybi and draft75. 2015-07-06 10:29:18 +09:00
James Coglan fa11841bfa Don't catch errors from event listeners. Instead, make sure that in all parsing methods in Hybi, @stage is set before any user called is invoked so the parser is in the right state before code that might raise is called. 2015-07-05 18:52:53 +01:00
James Coglan f11d5905d2 Merge pull request #28 from ioquatix/strem-reader-refactoring
Improve performance of StreamReader by reducing the number of buffer reallocations done.
2015-07-05 16:26:32 +01:00
James Coglan 83d317add2 Rescue from Exception when calling event listeners, and use the name 'error' for caught exceptions. 2015-07-05 15:31:36 +01:00
Samuel Williams 46f5ac8c6b Improve performance of StreamReader by reducing the number of buffer reallocations done. 2015-07-05 23:24:35 +09:00
James Coglan 585eded63d Remove unnecessary code to remove whitespace from Base64 output. 2015-07-04 21:13:06 +01:00
James Coglan 8eccf044b0 Change stage in the Base.shutdown() method to that all parsers stop processing input. 2015-07-04 21:06:50 +01:00
James Coglan f218999304 If an event listener emits an error, close the connection with code 1011. 2015-07-04 20:54:42 +01:00
James Coglan 767f4648da Document that on() *adds* a callback, rather than *setting* one, i.e. it does not remove any prior callbacks. 2015-07-04 19:31:58 +01:00
James Coglan d69cdaba97 Allow event listeners to be passed as normal rather than block arguments.
This discourages the inappropriate use of 'return' inside event
listeners. Also, we return the listener, so that the caller has a
reference to it in case they do pass a block.
2015-07-04 19:28:49 +01:00
James Coglan 7af53b5be0 Add a pong() command for sending unsolicited pong frames. 2015-07-04 18:49:46 +01:00
James Coglan ba39c553b6 Bump the Ruby versions for Travis. 2015-06-02 22:02:28 +01:00
James Coglan 6720cb2b4a The client should use secure random numbers for Sec-WebSocket-Key, and we should use the Base64.strict_encode function everywhere. 2015-06-02 22:01:22 +01:00
James Coglan 2bed2b6be5 List Sec-WebSocket-Extensions in the set of expected headers. 2015-04-09 18:29:35 +01:00
James Coglan c074c9dd10 Bump version to 0.5.4. 0.5.4 2015-03-29 23:14:59 +01:00
James Coglan 536e353bd4 Replace 'iff' with 'if and only if'. 2015-03-28 19:45:00 +00:00
James Coglan 168082b072 Test on Ruby 2.2.1. 2015-03-26 09:45:47 +00:00
James Coglan d6b147f2e0 Fail the connection when the server receives an invalid Sec-WebSocket-Extensions header. 2015-03-26 09:43:59 +00:00
James Coglan b78ed7706d Don't send a close frame in response to receiving one, if we already sent a close frame. 2015-03-14 10:03:26 +00:00
James Coglan 47fe3a7479 Bump version to 0.5.3. 0.5.3 2015-02-22 21:05:19 +00:00
James Coglan de23229e7f Don't parse incoming data if the client is already closed. This stops the headers being interpreted as WebSocket data if the client is closed before receiving the server's handshake. 2015-02-21 12:36:32 +00:00
James Coglan fcef3f6a31 Bump version to 0.5.2. 0.5.2 2015-02-19 22:43:31 +00:00
James Coglan 1e3cdbbd8c Test on Ruby 2.1.5 and 2.2.0. 2015-02-19 21:16:16 +00:00
James Coglan 2fd83762e0 Remove lines accidentally committed to Gemfile. 2015-02-16 09:42:03 +00:00
James Coglan 95c0261505 Don't emit further error/close events if the driver is already closing. 2015-02-16 09:08:18 +00:00
James Coglan 487965545e Bump version to 0.5.1. 0.5.1 2014-12-18 02:15:19 +00:00
James Coglan 7b4352bb2f Throw an error if drivers are created with unrecognised options. 2014-12-17 22:09:58 +00:00
James Coglan b99ab25583 Fix some string/array discrepancies in the hixie-{75,76} drivers. 0.5.0 2014-12-13 13:34:11 +00:00
James Coglan f02be94880 Bump version to 0.5.0 and document how to add extensions. 2014-12-13 13:14:11 +00:00
James Coglan e3e842a31d Don't test on jruby-18mode. 2014-12-09 22:22:45 +00:00
James Coglan 9bc3b9b3f6 Mistakenly used bytesize on an array. 2014-12-06 10:38:03 +00:00