rtunnel 0.3.5 → 0.3.6
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/lib/client.rb +7 -2
- data/lib/core.rb +1 -1
- data/lib/server.rb +6 -1
- metadata +2 -2
data/lib/client.rb
CHANGED
@@ -98,7 +98,7 @@ module RTunnel
|
|
98
98
|
write_to_control_sock RemoteListenCommand.new(@remote_listen_address)
|
99
99
|
|
100
100
|
cmd_queue = ""
|
101
|
-
while data = (@control_sock.readpartial(16384) rescue (D "#{$!.inspect}"; nil))
|
101
|
+
while data = (@control_sock.readpartial(16384) rescue (D "control sock read error: #{$!.inspect}"; nil))
|
102
102
|
cmd_queue << data
|
103
103
|
while Command.match(cmd_queue)
|
104
104
|
case command = Command.parse(cmd_queue)
|
@@ -117,11 +117,16 @@ module RTunnel
|
|
117
117
|
while localdata = conn.readpartial(16834)
|
118
118
|
write_to_control_sock SendDataCommand.new(cmd.conn_id, localdata)
|
119
119
|
end
|
120
|
-
rescue
|
120
|
+
rescue Exception
|
121
|
+
begin
|
121
122
|
D "to tunnel closed, closing from tunnel"
|
122
123
|
conn.close
|
123
124
|
CONNECTIONS.delete cmd.conn_id
|
124
125
|
write_to_control_sock CloseConnectionCommand.new(cmd.conn_id)
|
126
|
+
rescue
|
127
|
+
p $!
|
128
|
+
puts $!.backtrace.join("\n")
|
129
|
+
end
|
125
130
|
end
|
126
131
|
end
|
127
132
|
rescue Exception
|
data/lib/core.rb
CHANGED
data/lib/server.rb
CHANGED
@@ -89,7 +89,12 @@ module RTunnel
|
|
89
89
|
end
|
90
90
|
D "listening for remote connections on #{cmd.address}"
|
91
91
|
when SendDataCommand
|
92
|
-
RemoteListenServer::CONNECTIONS[cmd.conn_id]
|
92
|
+
conn = RemoteListenServer::CONNECTIONS[cmd.conn_id]
|
93
|
+
begin
|
94
|
+
conn.write(cmd.data) if conn
|
95
|
+
rescue Errno::EPIPE
|
96
|
+
D "broken pipe on #{cmd.conn_id}"
|
97
|
+
end
|
93
98
|
when CloseConnectionCommand
|
94
99
|
if connection = RemoteListenServer::CONNECTIONS[cmd.conn_id]
|
95
100
|
D "closing remote connection: #{cmd.conn_id}"
|
metadata
CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.9.4
|
|
3
3
|
specification_version: 1
|
4
4
|
name: rtunnel
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 0.3.
|
7
|
-
date:
|
6
|
+
version: 0.3.6
|
7
|
+
date: 2008-02-12 00:00:00 +07:00
|
8
8
|
summary: The author was too lazy to write a summary
|
9
9
|
require_paths:
|
10
10
|
- lib
|