ftpfxp 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/ftpfxp/ftpfxp.rb +5 -4
- data/lib/ftpfxp/ftpfxptls.rb +25 -12
- metadata +2 -2
data/lib/ftpfxp/ftpfxp.rb
CHANGED
@@ -142,10 +142,11 @@ module Net
|
|
142
142
|
dst.fxpsetport(ports)
|
143
143
|
dst.fxpstor(dstpath)
|
144
144
|
fxpretr(srcpath)
|
145
|
-
resp =
|
146
|
-
|
147
|
-
|
148
|
-
|
145
|
+
resp = {}
|
146
|
+
resp[:srcresp] = fxpwait
|
147
|
+
raise FTPFXPTLSSrcSiteError unless '226' == resp[:srcresp][0,3]
|
148
|
+
resp[:dstresp] = dst.fxpwait
|
149
|
+
raise FTPFXPTLSDstSiteError unless '226' == resp[:dstresp][0,3]
|
149
150
|
return resp
|
150
151
|
end
|
151
152
|
|
data/lib/ftpfxp/ftpfxptls.rb
CHANGED
@@ -89,10 +89,10 @@ module Net
|
|
89
89
|
|
90
90
|
# Protection buffer size must be set to 0 since FTP-TLS does
|
91
91
|
# not require this, but it still must be set.
|
92
|
-
|
92
|
+
fxppbsz(0)
|
93
93
|
|
94
94
|
# Set to P since we're using TLS.
|
95
|
-
|
95
|
+
fxpprotp
|
96
96
|
@secure_on = true
|
97
97
|
end
|
98
98
|
|
@@ -107,6 +107,17 @@ module Net
|
|
107
107
|
#
|
108
108
|
# :startdoc:
|
109
109
|
|
110
|
+
#
|
111
|
+
# This method sets the +protection buffer size+.
|
112
|
+
# Usually this is set to 0 for SSL/TLS transfers.
|
113
|
+
#
|
114
|
+
def fxppbsz(size)
|
115
|
+
synchronize do
|
116
|
+
putline("PBSZ #{size}")
|
117
|
+
return getresp
|
118
|
+
end
|
119
|
+
end
|
120
|
+
|
110
121
|
#
|
111
122
|
# This method notifies the server to start using protection mode.
|
112
123
|
# Must issue this command on both control connections
|
@@ -207,7 +218,7 @@ module Net
|
|
207
218
|
#
|
208
219
|
def fxpto(dst, dstpath, srcpath)
|
209
220
|
if not @secure_on
|
210
|
-
|
221
|
+
fxpprotp
|
211
222
|
@secure_on = true
|
212
223
|
end
|
213
224
|
|
@@ -217,10 +228,11 @@ module Net
|
|
217
228
|
dst.fxpsetport(ports)
|
218
229
|
dst.fxpstor(dstpath)
|
219
230
|
fxpretr(srcpath)
|
220
|
-
resp =
|
221
|
-
|
222
|
-
|
223
|
-
|
231
|
+
resp = {}
|
232
|
+
resp[:srcresp] = fxpwait
|
233
|
+
raise FTPFXPTLSSrcSiteError unless '226' == resp[:srcresp][0,3]
|
234
|
+
resp[:dstresp] = dst.fxpwait
|
235
|
+
raise FTPFXPTLSDstSiteError unless '226' == resp[:dstresp][0,3]
|
224
236
|
return resp
|
225
237
|
end
|
226
238
|
|
@@ -232,7 +244,7 @@ module Net
|
|
232
244
|
#
|
233
245
|
def fxpsscnto(dst, dstpath, srcpath)
|
234
246
|
if not @secure_on
|
235
|
-
|
247
|
+
fxpprotp
|
236
248
|
@secure_on = true
|
237
249
|
end
|
238
250
|
|
@@ -244,10 +256,11 @@ module Net
|
|
244
256
|
dst.fxpsetport(ports)
|
245
257
|
dst.fxpstor(dstpath)
|
246
258
|
fxpretr(srcpath)
|
247
|
-
resp =
|
248
|
-
|
249
|
-
|
250
|
-
|
259
|
+
resp = {}
|
260
|
+
resp[:srcresp] = fxpwait
|
261
|
+
raise FTPFXPTLSSrcSiteError unless '226' == resp[:srcresp][0,3]
|
262
|
+
resp[:dstresp] = dst.fxpwait
|
263
|
+
raise FTPFXPTLSDstSiteError unless '226' == resp[:dstresp][0,3]
|
251
264
|
return resp
|
252
265
|
end
|
253
266
|
|
metadata
CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.9.0
|
|
3
3
|
specification_version: 1
|
4
4
|
name: ftpfxp
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 0.0.
|
7
|
-
date: 2006-07-
|
6
|
+
version: 0.0.3
|
7
|
+
date: 2006-07-23 00:00:00 -04:00
|
8
8
|
summary: Extension to Net::FTP providing FXP and SSL/TLS support
|
9
9
|
require_paths:
|
10
10
|
- lib
|