socket_duplex 1.1.11 → 1.1.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: eaa0659456ec44cff795d7e3365a5e71cef4ed4a
4
- data.tar.gz: 82d8573fffa7ffdd7f5d4de04f136f425f741219
3
+ metadata.gz: 18de23c973bd33d6e9cea5bd88e302867b12d8c5
4
+ data.tar.gz: de3ef17ca8464a474075960b5e942dcf243a3519
5
5
  SHA512:
6
- metadata.gz: daa5670f0d3af2e9a3c77d4aefb5825bc84ec39267944a266d94354cd12766410db95c105dc5ac4bc714396c0cb51dd7e47eb6399900d0839a96d524b6cb545c
7
- data.tar.gz: f66c34b26061e75efdd8d2980fa2b86062b694eb53d53e9d846e1942db08452f48d7d49418ead9eab3944a52dd2c239bfa9ade88753310206848b05bcd59600c
6
+ metadata.gz: 40fd07b60069e41acf5dfbe5f932ced6883ead3b96e5616923fc861782ffd0197a8ae0923c44e525822b9044ed8a461cc96558d63d7237830d20a4af111fe497
7
+ data.tar.gz: 841a1c506013112b670cc9e490231dd81631f75be1215d5330aa13f391e4824171685f37d08641ebf675d9da51defd8c9d93d690203e839a5966b2f65f831efc
@@ -18,8 +18,6 @@ module Rack
18
18
  #@queue = SizedQueue.new(MAX_QUEUE_SIZE)
19
19
  @threads_to_sockets = {}
20
20
  #Thread.new { activate_workers() }
21
- Rails.logger.info "Process id: " + Process.pid.to_s
22
- Rails.logger.info "Init"
23
21
  rescue nil
24
22
  end
25
23
  end
@@ -29,8 +27,6 @@ module Rack
29
27
  if !defined? @queue
30
28
  @queue = SizedQueue.new(MAX_QUEUE_SIZE)
31
29
  activate_workers()
32
- Rails.logger.info "Process id: " + Process.pid.to_s
33
- Rails.logger.info "Init queue"
34
30
  end
35
31
  dup._call(env)
36
32
  rescue nil
@@ -59,10 +55,7 @@ module Rack
59
55
  begin
60
56
  env = @queue.pop
61
57
  if env
62
- Rails.logger.info "Process id: " + Process.pid.to_s
63
- Rails.logger.info "Connecting"
64
58
  connect_to_ws(Thread.current)
65
- Rails.logger.info "Sending"
66
59
  handle_request(env)
67
60
  end
68
61
  rescue nil
@@ -95,24 +88,16 @@ module Rack
95
88
 
96
89
  def handle_request(env)
97
90
  request_hash = {}
98
- Rails.logger.info "Url scheme " + env['rack.url_scheme']
99
- if env['rack.url_scheme'] == 'http'
100
- write_env(request_hash, env)
101
- Rails.logger.info "Done Writing env"
102
- ws = @threads_to_sockets[Thread.current]
103
- Rails.logger.info "WS id: " + ws.__id__.to_s
104
- begin
105
- ws.send request_hash.to_json
106
- Rails.logger.info "Process id: " + Process.pid.to_s
107
- Rails.logger.info "Sent"
108
- rescue Exception => e
109
- Rails.logger.info "Error sending"
110
- if ws
111
- ws.close()
112
- end rescue nil
113
- @threads_to_sockets[Thread.current] = nil
114
- end
115
- end rescue nil
91
+ write_env(request_hash, env)
92
+ ws = @threads_to_sockets[Thread.current]
93
+ begin
94
+ ws.send request_hash.to_json
95
+ rescue Exception => e
96
+ if ws
97
+ ws.close()
98
+ end rescue nil
99
+ @threads_to_sockets[Thread.current] = nil
100
+ end
116
101
  end
117
102
 
118
103
  def write_env(request_hash, env)
@@ -3,7 +3,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
3
 
4
4
  Gem::Specification.new do |spec|
5
5
  spec.name = "socket_duplex"
6
- spec.version = '1.1.11'
6
+ spec.version = '1.1.12'
7
7
  spec.authors = ["Secful"]
8
8
  spec.description = %q{Rack middleware that duplexes HTTP traffic}
9
9
  spec.summary = spec.description
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: socket_duplex
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.11
4
+ version: 1.1.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Secful