mojombo-proxymachine 0.1.3 → 0.2.0
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.
- data/VERSION.yml +2 -2
- data/examples/git.rb +2 -2
- data/examples/transparent.rb +1 -1
- data/lib/proxymachine/client_connection.rb +15 -8
- data/proxymachine.gemspec +2 -2
- metadata +2 -2
data/VERSION.yml
CHANGED
data/examples/git.rb
CHANGED
data/examples/transparent.rb
CHANGED
@@ -28,16 +28,24 @@ module EventMachine
|
|
28
28
|
def ensure_server_side_connection
|
29
29
|
@timer.cancel if @timer
|
30
30
|
unless @server_side
|
31
|
-
|
32
|
-
|
33
|
-
|
31
|
+
commands = ProxyMachine.router.call(@buffer.join)
|
32
|
+
close_connection unless commands.instance_of?(Hash)
|
33
|
+
if remote = commands[:remote]
|
34
|
+
m, host, port = *remote.match(/^(.+):(.+)$/)
|
34
35
|
if try_server_connect(host, port.to_i)
|
36
|
+
if data = commands[:data]
|
37
|
+
@buffer = [data]
|
38
|
+
end
|
35
39
|
send_and_clear_buffer
|
36
40
|
end
|
37
|
-
elsif
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
+
elsif close = commands[:close]
|
42
|
+
if close == true
|
43
|
+
close_connection
|
44
|
+
else
|
45
|
+
send_data(close)
|
46
|
+
close_connection_after_writing
|
47
|
+
end
|
48
|
+
elsif commands[:noop]
|
41
49
|
# do nothing
|
42
50
|
else
|
43
51
|
close_connection
|
@@ -68,7 +76,6 @@ module EventMachine
|
|
68
76
|
def send_and_clear_buffer
|
69
77
|
if !@buffer.empty?
|
70
78
|
@buffer.each do |x|
|
71
|
-
# p x
|
72
79
|
@server_side.send_data(x)
|
73
80
|
end
|
74
81
|
@buffer = []
|
data/proxymachine.gemspec
CHANGED
@@ -2,11 +2,11 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = %q{proxymachine}
|
5
|
-
s.version = "0.
|
5
|
+
s.version = "0.2.0"
|
6
6
|
|
7
7
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
8
8
|
s.authors = ["Tom Preston-Werner"]
|
9
|
-
s.date = %q{2009-
|
9
|
+
s.date = %q{2009-07-15}
|
10
10
|
s.default_executable = %q{proxymachine}
|
11
11
|
s.email = %q{tom@mojombo.com}
|
12
12
|
s.executables = ["proxymachine"]
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mojombo-proxymachine
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tom Preston-Werner
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-
|
12
|
+
date: 2009-07-15 00:00:00 -07:00
|
13
13
|
default_executable: proxymachine
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|