proxymachine 1.2.2 → 1.2.3

Sign up to get free protection for your applications and to get access to all the features.
data/History.txt CHANGED
@@ -1,3 +1,7 @@
1
+ = 1.2.3 / 2010-02-23
2
+ * Bug fixes
3
+ * Never retry after connection is established and data is sent
4
+
1
5
  = 1.2.2 / 2010-02-19
2
6
  * Bug fixes
3
7
  * Bring back the buffer limit
data/VERSION.yml CHANGED
@@ -1,5 +1,5 @@
1
1
  ---
2
2
  :major: 1
3
3
  :minor: 2
4
- :patch: 2
4
+ :patch: 3
5
5
  :build:
@@ -33,7 +33,7 @@ class ProxyMachine
33
33
  end
34
34
  rescue => e
35
35
  close_connection
36
- LOGGER.info "#{e.class} - #{e.message}"
36
+ LOGGER.error "#{e.class} - #{e.message}"
37
37
  end
38
38
 
39
39
  # Called when new data is available from the client but no remote
@@ -87,6 +87,7 @@ class ProxyMachine
87
87
  LOGGER.info "Successful connection to #{@remote.join(':')}"
88
88
  @connected = true
89
89
  @buffer.each { |data| @server_side.send_data(data) }
90
+ @buffer = []
90
91
  proxy_incoming_to(@server_side, 10240)
91
92
  end
92
93
 
@@ -96,12 +97,16 @@ class ProxyMachine
96
97
  # 10 times.
97
98
  def server_connection_failed
98
99
  @server_side = nil
99
- if @tries < 10
100
+ if @connected
101
+ LOGGER.error "Connection with #{@remote.join(':')} was terminated prematurely."
102
+ close_connection
103
+ ProxyMachine.connect_error_callback.call(@remote.join(':'))
104
+ elsif @tries < 10
100
105
  @tries += 1
101
- LOGGER.info "Retrying connection with #{@remote.join(':')} (##{@tries})"
106
+ LOGGER.warn "Retrying connection with #{@remote.join(':')} (##{@tries})"
102
107
  EM.add_timer(0.1) { connect_to_server }
103
108
  else
104
- LOGGER.info "Connect #{@remote.join(':')} failed after ten attempts."
109
+ LOGGER.error "Connect #{@remote.join(':')} failed after ten attempts."
105
110
  close_connection
106
111
  ProxyMachine.connect_error_callback.call(@remote.join(':'))
107
112
  end
@@ -112,7 +117,7 @@ class ProxyMachine
112
117
  # elapsed argument is the amount of time that actually elapsed since
113
118
  # connecting but not receiving any data.
114
119
  def server_inactivity_timeout(timeout, elapsed)
115
- LOGGER.info "Disconnecting #{@remote.join(':')} after #{elapsed}s of inactivity (> #{timeout.inspect})"
120
+ LOGGER.error "Disconnecting #{@remote.join(':')} after #{elapsed}s of inactivity (> #{timeout.inspect})"
116
121
  @server_side = nil
117
122
  close_connection
118
123
  ProxyMachine.inactivity_error_callback.call(@remote.join(':'))
data/proxymachine.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{proxymachine}
8
- s.version = "1.2.2"
8
+ s.version = "1.2.3"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Tom Preston-Werner"]
12
- s.date = %q{2010-02-19}
12
+ s.date = %q{2010-02-23}
13
13
  s.default_executable = %q{proxymachine}
14
14
  s.email = %q{tom@mojombo.com}
15
15
  s.executables = ["proxymachine"]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: proxymachine
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.2
4
+ version: 1.2.3
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: 2010-02-19 00:00:00 -08:00
12
+ date: 2010-02-23 00:00:00 -08:00
13
13
  default_executable: proxymachine
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency