faye-websocket 0.10.5 → 0.10.6

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of faye-websocket might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5dfb25398e331800baf73b73988b88639753fac9
4
- data.tar.gz: 86e8c6d23a38fa6e699be24dd0aa677a7ad29c0b
3
+ metadata.gz: 5b6bf17084f08c82f3d0d7ac138e98ddd2a0f059
4
+ data.tar.gz: 8b86e6161c6c6822f46675a8ac7644ad64257be8
5
5
  SHA512:
6
- metadata.gz: 8900d2b969e66c6a9a338cf763c00f9c59728884ce52c7fe1034d852487c323b14bcab97b4a411761f6bd6d6af7f600f5a2de67c9275be912acbfe50598a0512
7
- data.tar.gz: 6f8df7095506203c476b487383653ef28641bfba255b5febec138aa17af53f9b4e234f951e0f554107bbc461292ef4998cd91c94a0045dc470dc7236f6cfd5aa
6
+ metadata.gz: 41099891f06201e60913915da0bec5f3420b2ebaf955a80d5c17cf7d3cab53feac35e0a7376ad301880eb5245f9e7412304c4a448abdbb4a942c535d46c780a8
7
+ data.tar.gz: 66350cd838a0a77e20285130c28bcbe2a197d7179c729866ec5d38d78c8635c212c57670ca2496e0d292f1279825d21624b4a341a1e64df7a8fa83f1d6ab8f60
@@ -1,3 +1,8 @@
1
+ ### 0.10.6 / 2017-01-22
2
+
3
+ * Forcibly close the I/O stream after a timeout if the peer does not respond
4
+ after calling `close()`
5
+
1
6
  ### 0.10.5 / 2016-11-12
2
7
 
3
8
  * Set the SNI hostname when making secure requests
data/README.md CHANGED
@@ -493,7 +493,7 @@ end
493
493
 
494
494
  (The MIT License)
495
495
 
496
- Copyright (c) 2010-2016 James Coglan
496
+ Copyright (c) 2010-2017 James Coglan
497
497
 
498
498
  Permission is hereby granted, free of charge, to any person obtaining a copy of
499
499
  this software and associated documentation files (the 'Software'), to deal in
@@ -18,13 +18,12 @@ EM.run {
18
18
  socket.onmessage = lambda do |event|
19
19
  puts "Total cases to run: #{event.data}"
20
20
  cases = event.data.to_i
21
- progress = ProgressBar.new('Autobahn', cases)
21
+ progress = ProgressBar.create(:title => 'Autobahn', :total => cases)
22
22
  end
23
23
 
24
24
  run_case = lambda do |n|
25
25
  if n > cases
26
26
  socket = Faye::WebSocket::Client.new("#{host}/updateReports?agent=#{agent}")
27
- progress.finish
28
27
  socket.onclose = lambda { |e| EM.stop }
29
28
  next
30
29
  end
@@ -37,7 +36,7 @@ EM.run {
37
36
  end
38
37
 
39
38
  socket.on :close do |event|
40
- progress.inc
39
+ progress.increment
41
40
  run_case[n + 1]
42
41
  end
43
42
  end
@@ -10,6 +10,8 @@ module Faye
10
10
  CLOSING = 2
11
11
  CLOSED = 3
12
12
 
13
+ CLOSE_TIMEOUT = 30
14
+
13
15
  include EventTarget
14
16
 
15
17
  extend Forwardable
@@ -36,7 +38,7 @@ module Faye
36
38
  @ping_id = 0
37
39
  @buffered_amount = 0
38
40
 
39
- @close_params = @ping_timer = @proxy = @stream = nil
41
+ @close_params = @close_timer = @ping_timer = @proxy = @stream = nil
40
42
  @onopen = @onmessage = @onclose = @onerror = nil
41
43
 
42
44
  @driver.on(:open) { |e| open }
@@ -86,6 +88,8 @@ module Faye
86
88
 
87
89
  @ready_state = CLOSING unless @ready_state == CLOSED
88
90
  @driver.close(reason, code)
91
+
92
+ @close_timer = EventMachine.add_timer(CLOSE_TIMEOUT) { begin_close('', 1006) }
89
93
  end
90
94
 
91
95
  def protocol
@@ -133,6 +137,7 @@ module Faye
133
137
  return if @ready_state == CLOSED
134
138
  @ready_state = CLOSED
135
139
 
140
+ EventMachine.cancel_timer(@close_timer) if @close_timer
136
141
  EventMachine.cancel_timer(@ping_timer) if @ping_timer
137
142
 
138
143
  reason = @close_params ? @close_params[0] : ''
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: faye-websocket
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.5
4
+ version: 0.10.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Coglan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-11-12 00:00:00.000000000 Z
11
+ date: 2017-01-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: eventmachine
@@ -247,7 +247,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
247
247
  version: '0'
248
248
  requirements: []
249
249
  rubyforge_project:
250
- rubygems_version: 2.5.1
250
+ rubygems_version: 2.6.8
251
251
  signing_key:
252
252
  specification_version: 4
253
253
  summary: Standards-compliant WebSocket server and client