mirror of
https://github.com/3proxy/3proxy.git
synced 2025-02-23 18:45:40 +08:00
EPSV support for ftppr
This commit is contained in:
parent
2c0bc19f75
commit
ee0bb55c06
@ -88,6 +88,7 @@ void * ftpprchild(struct clientparam* param) {
|
||||
}
|
||||
else if (status >= 3 && (
|
||||
(!strncasecmp((char *)buf, "PASV", 4) && (pasv = 1)) ||
|
||||
(!strncasecmp((char *)buf, "EPSV", 4) && (pasv = 2)) ||
|
||||
(!strncasecmp((char *)buf, "PORT ", 5) && !(pasv = 0))
|
||||
)){
|
||||
#ifndef WITHMAIN
|
||||
@ -125,6 +126,7 @@ void * ftpprchild(struct clientparam* param) {
|
||||
if(so._listen(clidatasock, 1)) {RETURN(823);}
|
||||
sasize = sizeof(param->sincl);
|
||||
if(so._getsockname(clidatasock, (struct sockaddr *)¶m->sincl, &sasize)){RETURN(824);}
|
||||
if(pasv == 1){
|
||||
if(*SAFAMILY(¶m->sincl) == AF_INET)
|
||||
sprintf((char *)buf, "227 OK (%u,%u,%u,%u,%u,%u)\r\n",
|
||||
(unsigned)(((unsigned char *)(SAADDR(¶m->sincl)))[0]),
|
||||
@ -139,6 +141,12 @@ void * ftpprchild(struct clientparam* param) {
|
||||
(unsigned)(((unsigned char *)(SAPORT(¶m->sincl)))[1])
|
||||
);
|
||||
}
|
||||
else {
|
||||
sprintf((char *)buf, "227 OK (|||%u|)\r\n",
|
||||
(unsigned)ntohs(*SAPORT(¶m->sincl))
|
||||
);
|
||||
}
|
||||
}
|
||||
else {
|
||||
unsigned long b1, b2, b3, b4;
|
||||
unsigned short b5, b6;
|
||||
|
Loading…
Reference in New Issue
Block a user