Commit Graph

418 Commits

Author SHA1 Message Date
James Coglan 3ae2e3a0f6 Validate UTF-8 encoding of strings where needed, not on every call to Driver.encode 2021-02-26 16:26:08 +00:00
James Coglan 9ec01dc328 Avoid allocating an array of the string bytes in Hybi#emit_frame 2021-02-26 16:14:58 +00:00
James Coglan 472569ad38 Avoid allocating so many arrays during Hybi#frame 2021-02-26 16:14:53 +00:00
James Coglan 219c409844 Use the Ruby Encoding constants instead of their string names 2021-02-26 14:44:50 +00:00
James Coglan c73f5bcf10 Update Ruby versions on Travis 2021-02-26 14:42:18 +00:00
James Coglan c021b23aef Merge pull request #77 from timcraft/patch-1
Test on ruby 3.0
2021-01-06 15:32:11 +00:00
timcraft bd44d80c6e Test on ruby 3.0 2021-01-06 14:55:22 +00:00
James Coglan eb643f5949 Bump version to 0.7.3 0.7.3 2020-07-09 19:27:04 +01:00
James Coglan e87bfef9bc Accept HTTP responses that have an empty reason-phrase, per RFC 2616 2020-07-09 19:06:13 +01:00
James Coglan f882bc56d5 Bump version to 0.7.2 0.7.2 2020-05-22 16:06:12 +01:00
James Coglan 46aafa4e99 Set {source,target}_version to work with the current version of javac on macOS 2020-05-14 23:31:30 +01:00
James Coglan db09a1af22 Update Ruby versions 2.4 to 2.7 on Travis 2020-05-14 17:20:25 +01:00
pjaspers 202e1800e0 Allow rack.input.read to return a frozen string
We're seeing this occasionally in our error logs, where the `env`
passed into to the driver will return a frozen string when read.

The stack trace always includes ActionCable in to the mix, so
something like this:

      "/app/vendor/bundle/ruby/2.6.0/gems/websocket-driver-0.7.0/lib/websocket/driver/draft76.rb" line 11 in force_encoding
      "/app/vendor/bundle/ruby/2.6.0/gems/websocket-driver-0.7.0/lib/websocket/driver/draft76.rb" line 11 in initialize
      "/app/vendor/bundle/ruby/2.6.0/gems/websocket-driver-0.7.0/lib/websocket/driver.rb" line 162 in new
      "/app/vendor/bundle/ruby/2.6.0/gems/websocket-driver-0.7.0/lib/websocket/driver.rb" line 162 in rack
      "/app/vendor/bundle/ruby/2.6.0/gems/actioncable-5.2.3/lib/action_cable/connection/client_socket.rb" line 47 in initialize
      "/app/vendor/bundle/ruby/2.6.0/gems/actioncable-5.2.3/lib/action_cable/connection/web_socket.rb" line 10 in new
      "/app/vendor/bundle/ruby/2.6.0/gems/actioncable-5.2.3/lib/action_cable/connection/web_socket.rb" line 10 in initialize
      "/app/vendor/bundle/ruby/2.6.0/gems/actioncable-5.2.3/lib/action_cable/connection/base.rb" line 59 in new
      "/app/vendor/bundle/ruby/2.6.0/gems/actioncable-5.2.3/lib/action_cable/connection/base.rb" line 59 in initialize
      "/app/vendor/bundle/ruby/2.6.0/gems/actioncable-5.2.3/lib/action_cable/server/base.rb" line 30 in new
      "/app/vendor/bundle/ruby/2.6.0/gems/actioncable-5.2.3/lib/action_cable/server/base.rb" line 30 in call

I still don't quite know why someone is sometimes returning a frozen
string (it could also have to with any of the current rack middleware
we're using), but I do know that we can handle it here.

So this adds a spec and some behavior to fix that.
2020-05-14 16:22:20 +01:00
James Coglan b00f58701e Emit ping and pong events from the Server driver 2020-02-14 14:41:43 +01:00
James Coglan d05eb72d2d Mention license change in the changelog 2019-06-13 11:40:48 +01:00
James Coglan e568366f82 Formatting change: {...} should have spaces inside the braces 2019-06-11 16:12:52 +01:00
James Coglan 92334974c5 Bump version to 0.7.1 0.7.1 2019-06-10 12:40:06 +01:00
James Coglan a6bb6a69a9 Change markdown formatting of docs. 2019-05-29 15:34:34 +01:00
James Coglan 019ba714cd Remove a redundant statement from the Hybi setup code. 2019-05-29 00:10:46 +01:00
James Coglan 03b46b8db6 Fail a draft-76 connection of a header does not contain any digits. 2019-05-29 00:10:46 +01:00
James Coglan 6b519eecc3 Depend on Rake < 12.3 if we're running on Ruby < 2.0. 2019-05-28 22:23:36 +01:00
James Coglan 77ae543784 Reformat the C and Java native extension modules. 2019-05-28 22:23:36 +01:00
James Coglan 8a6f9ef737 Fix an uninitialised variable warning. 2019-05-24 14:59:01 +01:00
James Coglan 5b957c6660 Update Travis target versions. 2019-05-24 14:43:05 +01:00
James Coglan 2c19210a69 Switch license to Apache 2.0. 2019-05-24 14:38:29 +01:00
James Coglan ee39af83d0 Test on Ruby 2.5.0. 2018-02-19 21:02:43 +00:00
James Coglan ec94a219e9 I think you have to use jruby-head instead of jruby-9 now. 2017-11-23 23:14:37 +00:00
James Coglan b14488aac5 Bump the Ruby versions for Travis. 2017-11-23 23:03:01 +00:00
James Coglan 11476318ea If any header used by Hybi is present, then pick Hybi, and likewise for Draft76. This means the driver is more likely to pick Hybi and report likely combinations of malformed headers as errors to the client. 2017-11-23 23:02:15 +00:00
James Coglan 2ec898c6a1 If any driver encounters a validation error in the request headers, it can throw an error and Driver#start will catch that and send a 400 response to the client. 2017-11-23 23:01:26 +00:00
James Coglan 12d2aa8a80 Fix the version of Rubygems that Travis is using on Ruby 1.9. 0.7.0 2017-09-11 22:05:09 +01:00
James Coglan 222e93a01c Bump version to 0.7.0. 2017-09-11 22:00:08 +01:00
James Coglan bc03ce72fe Refactor the client examples, and get the TCPSocket one into a runnable state so it can be run from the command line with a URI. 2017-08-15 19:00:04 +01:00
James Coglan bed599ae32 Don't require rubygems, this has not been necessary since Ruby 1.8. 2017-08-08 23:41:48 +01:00
James Coglan d3aee30def Merge pull request #53 from izwick-schachter/master
Added TCPSocket client example
2017-08-08 23:30:14 +01:00
izwick-schachter 391c3d0426 Added TCPSocket client example 2017-08-08 13:44:08 -04:00
James Coglan 8739c7966f Rename tcp_server.rb to em_server.rb. 2017-08-08 08:55:13 +01:00
James Coglan 77e46d6fce Add an example EventMachine client. 2017-08-08 08:54:50 +01:00
James Coglan 06f215611e Flesh out the docs for the new ping/pong events. 2017-08-02 21:55:14 +01:00
James Coglan cd38349f9a Make the ping/pong tests check the content of the events. 2017-08-02 21:54:59 +01:00
James Coglan 5daa01be5e Emit ping and pong events after all other effects of those frames have been carried out. 2017-08-02 21:32:17 +01:00
James Coglan 1ea7205acf Merge pull request #51 from ably-forks/support-ping-in-event-emitter
Support ping in EventEmitter
2017-08-02 21:28:31 +01:00
James Coglan 7dba28caa2 Update Ruby versions in Travis config. 2017-08-01 20:34:39 +01:00
Matthew O'Riordan dacae81312 Update docs to reflect ping & pong events 2017-05-16 15:01:27 +01:00
Matthew O'Riordan f22c97f977 Emit :ping and :pong events in the driver 2017-05-16 15:00:10 +01:00
James Coglan 65c068b24d Merge pull request #50 from junaruga/feature/travis-ruby-head
Feature/travis ruby head
2017-04-14 10:32:59 +01:00
Jun Aruga cab7ae1b29 Update Ruby 2.3, 2.4 to latest version on Travis. 2017-04-03 19:31:18 +02:00
James Coglan 38b8f63f10 Bump version to 0.6.5. 0.6.5 2017-01-22 19:58:03 +00:00
James Coglan 2936754e81 Test on Ruby 2.4.0. 2016-12-29 11:30:09 +00:00
James Coglan 4fa9e19063 Merge pull request #48 from kbarrette/pure_ruby_masking
Pure Ruby masking
2016-12-27 15:07:32 +00:00