mirror of
				https://github.com/3proxy/3proxy.git
				synced 2025-11-04 07:42:39 +08:00 
			
		
		
		
	More legacy code removed
This commit is contained in:
		
							parent
							
								
									faf5b4b124
								
							
						
					
					
						commit
						cb590049b3
					
				
							
								
								
									
										32
									
								
								src/ftp.c
									
									
									
									
									
								
							
							
						
						
									
										32
									
								
								src/ftp.c
									
									
									
									
									
								
							@ -33,11 +33,7 @@ int ftplogin(struct clientparam *param, char *nbuf, int *innbuf) {
 | 
				
			|||||||
	if((int)socksend(param->remsock, (unsigned char *)buf, (int)strlen(buf), conf.timeouts[STRING_S]) != (int)strlen(buf)){
 | 
						if((int)socksend(param->remsock, (unsigned char *)buf, (int)strlen(buf), conf.timeouts[STRING_S]) != (int)strlen(buf)){
 | 
				
			||||||
		return 703;
 | 
							return 703;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
#ifndef NOPSTDIN
 | 
					 | 
				
			||||||
	param->statscli64 += (int)strlen(buf);
 | 
						param->statscli64 += (int)strlen(buf);
 | 
				
			||||||
#else
 | 
					 | 
				
			||||||
	param->statscli += (int)strlen(buf);
 | 
					 | 
				
			||||||
#endif
 | 
					 | 
				
			||||||
	param->nwrites++;
 | 
						param->nwrites++;
 | 
				
			||||||
	while((i = sockgetlinebuf(param, SERVER, (unsigned char *)buf, len - 1, '\n', conf.timeouts[STRING_L])) > 0 && (i < 3 || !isnumber(*buf) || buf[3] == '-')){
 | 
						while((i = sockgetlinebuf(param, SERVER, (unsigned char *)buf, len - 1, '\n', conf.timeouts[STRING_L])) > 0 && (i < 3 || !isnumber(*buf) || buf[3] == '-')){
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
@ -54,11 +50,7 @@ int ftplogin(struct clientparam *param, char *nbuf, int *innbuf) {
 | 
				
			|||||||
		if((int)socksend(param->remsock, (unsigned char *)buf, res, conf.timeouts[STRING_S]) != (int)strlen(buf)){
 | 
							if((int)socksend(param->remsock, (unsigned char *)buf, res, conf.timeouts[STRING_S]) != (int)strlen(buf)){
 | 
				
			||||||
			return 705;
 | 
								return 705;
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
#ifndef NOPSTDIN
 | 
					 | 
				
			||||||
	param->statscli64 += res;
 | 
						param->statscli64 += res;
 | 
				
			||||||
#else
 | 
					 | 
				
			||||||
	param->statscli += res;
 | 
					 | 
				
			||||||
#endif
 | 
					 | 
				
			||||||
		param->nwrites++;
 | 
							param->nwrites++;
 | 
				
			||||||
		while((i = sockgetlinebuf(param, SERVER, (unsigned char *)buf, len - 1, '\n', conf.timeouts[STRING_L])) > 0){
 | 
							while((i = sockgetlinebuf(param, SERVER, (unsigned char *)buf, len - 1, '\n', conf.timeouts[STRING_L])) > 0){
 | 
				
			||||||
			buf[i] = 0;
 | 
								buf[i] = 0;
 | 
				
			||||||
@ -89,11 +81,7 @@ int ftpcd(struct clientparam *param, unsigned char* path, char *nbuf, int *innbu
 | 
				
			|||||||
	if((int)socksend(param->remsock, (unsigned char *)buf, (int)strlen(buf), conf.timeouts[STRING_S]) != (int)strlen(buf)){
 | 
						if((int)socksend(param->remsock, (unsigned char *)buf, (int)strlen(buf), conf.timeouts[STRING_S]) != (int)strlen(buf)){
 | 
				
			||||||
		return 711;
 | 
							return 711;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
#ifndef NOPSTDIN
 | 
					 | 
				
			||||||
	param->statscli64 += (int)strlen(buf);
 | 
						param->statscli64 += (int)strlen(buf);
 | 
				
			||||||
#else
 | 
					 | 
				
			||||||
	param->statscli += (int)strlen(buf);
 | 
					 | 
				
			||||||
#endif
 | 
					 | 
				
			||||||
	param->nwrites++;
 | 
						param->nwrites++;
 | 
				
			||||||
	while((i = sockgetlinebuf(param, SERVER, (unsigned char *)buf, sizeof(buf) - 1, '\n', conf.timeouts[STRING_L])) > 0 && (i < 3 || !isnumber(*buf) || buf[3] == '-')){
 | 
						while((i = sockgetlinebuf(param, SERVER, (unsigned char *)buf, sizeof(buf) - 1, '\n', conf.timeouts[STRING_L])) > 0 && (i < 3 || !isnumber(*buf) || buf[3] == '-')){
 | 
				
			||||||
		if(nbuf && innbuf && inbuf + i < *innbuf && i > 6) {
 | 
							if(nbuf && innbuf && inbuf + i < *innbuf && i > 6) {
 | 
				
			||||||
@ -126,11 +114,7 @@ int ftpsyst(struct clientparam *param, unsigned char *buf, unsigned len){
 | 
				
			|||||||
	if(socksend(param->remsock, (unsigned char *)"SYST\r\n", 6, conf.timeouts[STRING_S]) != 6){
 | 
						if(socksend(param->remsock, (unsigned char *)"SYST\r\n", 6, conf.timeouts[STRING_S]) != 6){
 | 
				
			||||||
		return 721;
 | 
							return 721;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
#ifndef NOPSTDIN
 | 
					 | 
				
			||||||
	param->statscli64 += 6;
 | 
						param->statscli64 += 6;
 | 
				
			||||||
#else
 | 
					 | 
				
			||||||
	param->statscli += 6;
 | 
					 | 
				
			||||||
#endif
 | 
					 | 
				
			||||||
	param->nwrites++;
 | 
						param->nwrites++;
 | 
				
			||||||
	while((i = sockgetlinebuf(param, SERVER, buf, len - 1, '\n', conf.timeouts[STRING_L])) > 0 && (i < 3 || !isnumber(*buf) || buf[3] == '-')){
 | 
						while((i = sockgetlinebuf(param, SERVER, buf, len - 1, '\n', conf.timeouts[STRING_L])) > 0 && (i < 3 || !isnumber(*buf) || buf[3] == '-')){
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
@ -149,11 +133,7 @@ int ftppwd(struct clientparam *param, unsigned char *buf, unsigned len){
 | 
				
			|||||||
	if(socksend(param->remsock, (unsigned char *)"PWD\r\n", 5, conf.timeouts[STRING_S]) != 5){
 | 
						if(socksend(param->remsock, (unsigned char *)"PWD\r\n", 5, conf.timeouts[STRING_S]) != 5){
 | 
				
			||||||
		return 731;
 | 
							return 731;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
#ifndef NOPSTDIN
 | 
					 | 
				
			||||||
	param->statscli64 += 5;
 | 
						param->statscli64 += 5;
 | 
				
			||||||
#else
 | 
					 | 
				
			||||||
	param->statscli += 5;
 | 
					 | 
				
			||||||
#endif
 | 
					 | 
				
			||||||
	param->nwrites++;
 | 
						param->nwrites++;
 | 
				
			||||||
	while((i = sockgetlinebuf(param, SERVER, buf, len - 1, '\n', conf.timeouts[STRING_L])) > 0 && (i < 3 || !isnumber(*buf) || buf[3] == '-')){
 | 
						while((i = sockgetlinebuf(param, SERVER, buf, len - 1, '\n', conf.timeouts[STRING_L])) > 0 && (i < 3 || !isnumber(*buf) || buf[3] == '-')){
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
@ -178,11 +158,7 @@ int ftptype(struct clientparam *param, unsigned char* f_type){
 | 
				
			|||||||
	if((int)socksend(param->remsock, (unsigned char *)buf, (int)strlen(buf), conf.timeouts[STRING_S]) != (int)strlen(buf)){
 | 
						if((int)socksend(param->remsock, (unsigned char *)buf, (int)strlen(buf), conf.timeouts[STRING_S]) != (int)strlen(buf)){
 | 
				
			||||||
		return 741;
 | 
							return 741;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
#ifndef NOPSTDIN
 | 
					 | 
				
			||||||
	param->statscli64 += (int)strlen(buf);
 | 
						param->statscli64 += (int)strlen(buf);
 | 
				
			||||||
#else
 | 
					 | 
				
			||||||
	param->statscli += (int)strlen(buf);
 | 
					 | 
				
			||||||
#endif
 | 
					 | 
				
			||||||
	param->nwrites++;
 | 
						param->nwrites++;
 | 
				
			||||||
	while((i = sockgetlinebuf(param, SERVER, (unsigned char *)buf, sizeof(buf) - 1, '\n', conf.timeouts[STRING_L])) > 0 && (i < 3 || !isnumber(*buf) || buf[3] == '-')){
 | 
						while((i = sockgetlinebuf(param, SERVER, (unsigned char *)buf, sizeof(buf) - 1, '\n', conf.timeouts[STRING_L])) > 0 && (i < 3 || !isnumber(*buf) || buf[3] == '-')){
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
@ -203,11 +179,7 @@ SOCKET ftpdata(struct clientparam *param){
 | 
				
			|||||||
	if(socksend(param->remsock, (unsigned char *)"PASV\r\n", 6, conf.timeouts[STRING_S]) != 6){
 | 
						if(socksend(param->remsock, (unsigned char *)"PASV\r\n", 6, conf.timeouts[STRING_S]) != 6){
 | 
				
			||||||
		return INVALID_SOCKET;
 | 
							return INVALID_SOCKET;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
#ifndef NOPSTDIN
 | 
					 | 
				
			||||||
	param->statscli64 += 6;
 | 
						param->statscli64 += 6;
 | 
				
			||||||
#else
 | 
					 | 
				
			||||||
	param->statscli += 6;
 | 
					 | 
				
			||||||
#endif
 | 
					 | 
				
			||||||
	param->nwrites++;
 | 
						param->nwrites++;
 | 
				
			||||||
	while((i = sockgetlinebuf(param, SERVER, (unsigned char *)buf, sizeof(buf) - 1, '\n', conf.timeouts[STRING_L])) > 0 && (i < 3 || !isnumber(*buf) || buf[3] == '-')){
 | 
						while((i = sockgetlinebuf(param, SERVER, (unsigned char *)buf, sizeof(buf) - 1, '\n', conf.timeouts[STRING_L])) > 0 && (i < 3 || !isnumber(*buf) || buf[3] == '-')){
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
@ -245,11 +217,7 @@ SOCKET ftpcommand(struct clientparam *param, unsigned char * command, unsigned c
 | 
				
			|||||||
		so._closesocket(s);
 | 
							so._closesocket(s);
 | 
				
			||||||
		return INVALID_SOCKET;
 | 
							return INVALID_SOCKET;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
#ifndef NOPSTDIN
 | 
					 | 
				
			||||||
	param->statscli64 += (int)strlen(buf);
 | 
						param->statscli64 += (int)strlen(buf);
 | 
				
			||||||
#else
 | 
					 | 
				
			||||||
	param->statscli += (int)strlen(buf);
 | 
					 | 
				
			||||||
#endif
 | 
					 | 
				
			||||||
	param->nwrites++;
 | 
						param->nwrites++;
 | 
				
			||||||
	while((i = sockgetlinebuf(param, SERVER, (unsigned char *)buf, sizeof(buf) - 1, '\n', conf.timeouts[STRING_L])) > 0 && (i < 3 || !isnumber(*buf) || buf[3] == '-')){
 | 
						while((i = sockgetlinebuf(param, SERVER, (unsigned char *)buf, sizeof(buf) - 1, '\n', conf.timeouts[STRING_L])) > 0 && (i < 3 || !isnumber(*buf) || buf[3] == '-')){
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user