1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
|
--- pftpfxp-mew.orig/src/server.cc Sun Nov 9 20:51:19 2003
+++ pftpfxp-mew/src/server.cc Wed Jun 9 10:59:21 2004
@@ -3277,7 +3277,14 @@
return (FALSE);
}
} else {
- if (!this->tcp.SendData("PASV\r\n")) {
+ sprintf(this->temp_string, "PRET RETR %s\r\n", file);
+ if (!this->tcp.SendData(this->temp_string)) {
+ this->error = E_CONTROL_RESET;
+ this->PostBusy(NULL);
+ return (FALSE);
+ }
+ this->tcp.WaitForMessage();
+ if (!this->tcp.SendData("PASV\r\n")) {
this->error = E_CONTROL_RESET;
this->PostBusy(NULL);
return (FALSE);
@@ -3687,7 +3694,15 @@
}
if (fxpmethod == 0) {
- if (nossl != 1 && dest->nossl != 1 && prefs.use_ssl_fxp && dest->prefs.use_ssl_fxp) {
+ sprintf(this->temp_string, "PRET RETR %s\r\n", file);
+ if (!this->tcp.SendData(this->temp_string)) {
+ this->error = E_CONTROL_RESET;
+ this->PostBusy(NULL);
+ dest->PostBusy(NULL);
+ return (FALSE);
+ }
+ this->tcp.WaitForMessage();
+ if (nossl != 1 && dest->nossl != 1 && prefs.use_ssl_fxp && dest->prefs.use_ssl_fxp) {
// dest & src support ssl and want ssl_fxp
// send CPSV, extract PORT info and post file, then wait (until DEST sent PORT and then STOR)
if (!this->tcp.SendData("CPSV\r\n")) {
@@ -3909,7 +3924,15 @@
fxpmeth1:
if (fxpmethod == 1) {
debuglog("normal fxp rejected trying alternative method");
- if (nossl != 1 && dest->nossl != 1 && prefs.use_ssl_fxp && dest->prefs.use_ssl_fxp) {
+ sprintf(this->temp_string, "PRET STOR %s\r\n", file);
+ if (!dest->tcp.SendData(this->temp_string)) {
+ this->error = E_CONTROL_RESET;
+ this->PostBusy(NULL);
+ dest->PostBusy(NULL);
+ return (FALSE);
+ }
+ dest->tcp.WaitForMessage();
+ if (nossl != 1 && dest->nossl != 1 && prefs.use_ssl_fxp && dest->prefs.use_ssl_fxp) {
// dest & src support ssl and want ssl_fxp
// send CPSV, extract PORT info and post file, then wait (until DEST sent PORT and then RETR)
if (!dest->tcp.SendData("CPSV\r\n")) {
@@ -3920,8 +3943,15 @@
return (FALSE);
}
} else {
- // send PASV, extract PORT info and post file, then wait (until DEST sent PORT and then RETR)
- if (!dest->tcp.SendData("PASV\r\n")) {
+ sprintf(this->temp_string, "PRET STOR %s\r\n", file);
+ if (!this->tcp.SendData(this->temp_string)) {
+ this->error = E_CONTROL_RESET;
+ this->PostBusy(NULL);
+ return (FALSE);
+ }
+ this->tcp.WaitForMessage();
+ // send PASV, extract PORT info and post file, then wait (until DEST sent PORT and then RETR)
+ if (!dest->tcp.SendData("PASV\r\n")) {
this->error = E_CONTROL_RESET;
this->PostBusy(NULL);
dest->PostBusy(NULL);
@@ -4080,7 +4110,7 @@
}
}
//this->PostStatusFile(file, "RETR_OK", port_msg); // notify dest and GO!
- this->PostBusy("FXP>");
+ this->PostBusy("FXP>");
dest->PostBusy("FXP<");
this->StartTime();
dest->StartTime();
@@ -4491,6 +4521,13 @@
return (FALSE);
}
} else { /* PASV MODE */
+ if(!this->tcp.SendData("PRET LIST\r\n")) {
+ this->error = E_CONTROL_RESET;
+ this->PostBusy(NULL);
+ return (FALSE);
+ }
+ this->tcp.WaitForMessage();
+
if (!this->tcp.SendData("PASV\r\n")) {
this->error = E_CONTROL_RESET;
this->PostBusy(NULL);
|