lib/submodules/ably-ruby/lib/ably/realtime/connection.rb in ably-rest-1.1.6 vs lib/submodules/ably-ruby/lib/ably/realtime/connection.rb in ably-rest-1.1.7
- old
+ new
@@ -80,10 +80,13 @@
}.freeze
# Max number of messages to bundle in a single ProtocolMessage
MAX_PROTOCOL_MESSAGE_BATCH_SIZE = 50
+ # Max message size
+ MAX_MESSAGE_SIZE = 65536 # See spec TO3l8
+
# A unique public identifier for this connection, used to identify this member in presence events and messages
# @return [String]
attr_reader :id
# A unique private connection key used to recover this connection, assigned by Ably
@@ -290,11 +293,11 @@
# @return [EventMachine::Deferrable]
# @api private
def internet_up?
url = "http#{'s' if client.use_tls?}:#{Ably::INTERNET_CHECK.fetch(:url)}"
EventMachine::DefaultDeferrable.new.tap do |deferrable|
- EventMachine::HttpRequest.new(url).get.tap do |http|
+ EventMachine::HttpRequest.new(url, tls: { verify_peer: true }).get.tap do |http|
http.errback do
yield false if block_given?
deferrable.fail Ably::Exceptions::ConnectionFailed.new("Unable to connect to #{url}", nil, Ably::Exceptions::Codes::CONNECTION_FAILED)
end
http.callback do
@@ -432,10 +435,10 @@
auth_deferrable.callback do |auth_params|
url_params = auth_params.merge(
'format' => client.protocol,
'echo' => client.echo_messages,
'v' => Ably::PROTOCOL_VERSION,
- 'lib' => client.rest_client.lib_version_id,
+ 'agent' => client.rest_client.agent
)
# Use native websocket heartbeats if possible, but allow Ably protocol heartbeats
url_params['heartbeats'] = if defaults.fetch(:websocket_heartbeats_disabled)
'true'