Article delegate-en/2812 of [1-5169] on the server localhost:119
  upper oldest olders older1 this newer1 newers latest
search
[Top/Up] [oldest] - [Older+chunk] - [Newer+chunk] - [newest + Check]
[Reference:<_A2811@delegate-en.ML_>]
Newsgroups: mail-lists.delegate-en

[DeleGate-En] Re: No chunked download FTP/HTTP...why?? log example...
08 Jan 2005 17:37:54 GMT feedback@delegate.org (Yutaka Sato)
The DeleGate Project


On 01/08/05(22:39) you Poul <p6yfabdyi-tqqtzdyfazfr.ml@ml.delegate.org> wrote
in <_A2811@delegate-en.ML_>
 |> I modified DeleGate to support partial getting for FTP/HTTP without
 |> downloading an entire file, as enclosed patch.
 |> The modified version is uploaded as 8.10.4-pre8 too.
 |
 |This version work fine :) exept:
 |after resume Delegate report to Opera wrong file size so file after  
 |downloading is shorter and not readable or executable...
 |(seems shorter on downloaded portion...
 |full size 100000
 |stop after 10000
 |resume
 |reported size 90000
 |stop after 15000
 |resume
 |reported 85000....
 |)
 |
 |This happens with ProFTPD 1.2.9 running on ftp.lcard.ru for example...
 |
 |But for ftp.delegate.org it work fine... for ftp.mp3.int.ru too....
 |
 |this is example log:
 |
 |problem maybe in this:
 |
 |01/08 16:26:07.13 [943] 0+0: I-SAY: RETR asentlnx.exe^M
 |01/08 16:26:07.19 [943] 0+0: FTP-SERVER-SAYS: 150 Opening BINARY mode data  
 |connection for asentlnx.exe (39057223 bytes)^M
 |
 |01/08 16:26:18.38 [946] 0+0: I-SAY: RETR asentlnx.exe^M
 |01/08 16:26:18.44 [946] 0+0: FTP-SERVER-SAYS: 150 Opening BINARY mode data  
 |connection for asentlnx.exe (38942771 bytes)^M

Since the message text for 150 response does not standardized, it can 
contain the size of response after REST(restart), or the size of file,
or none.  So I'll use the response for SIZE command, which is expected
to be implemented on a server which supports REST.  The enclosed patch
will do it.

Cheers,
Yutaka
--
  D G   Yutaka Sato <y.sato@delegate.org> http://delegate.org/y.sato/
 ( - )  National Institute of Advanced Industrial Science and Technology
_<   >_ 1-1-4 Umezono, Tsukuba, Ibaraki, 305-8568 Japan
Do the more with the less -- B. Fuller


diff -cr dist/delegate8.10.4-pre8/src/ftp.c ./src/ftp.c
*** dist/delegate8.10.4-pre8/src/ftp.c	Sat Jan  8 20:46:38 2005
--- ./src/ftp.c	Sun Jan  9 02:32:03 2005
***************
*** 2595,2600 ****
--- 2595,2607 ----
  		isdir = 1;
  	}
  
+ 	if( !isdir ){
+ 		CStr(size,1024);
+ 		sprintf(size,"SIZE %s",path);
+ 		if( put_get(ts,fs,AVStr(resp),rsize,"%s\r\n",size) != EOF ){
+ 			sscanf(resp,"213 %d",&Conn->sv.p_range[2]);
+ 		}
+ 	}
  	if( 0 < reqPART_FROM ){
  		CStr(rest,128);
  		sprintf(rest,"REST %d",reqPART_FROM);
***************
*** 5466,5471 ****
--- 5473,5479 ----
  	if( cfp != NULL ){
  		sprintf(resp,"150 Opening cached verified data (%d bytes)\r\n",
  			file_size(fileno(cfp)));
+ 		Conn->sv.p_range[2] = file_size(fileno(cfp));
  		*isdirp = 0;
  		return cfp;
  	}
diff -cr dist/delegate8.10.4-pre8/src/ftpgw.c ./src/ftpgw.c
*** dist/delegate8.10.4-pre8/src/ftpgw.c	Sat Jan  8 20:41:19 2005
--- ./src/ftpgw.c	Sun Jan  9 02:27:19 2005
***************
*** 886,891 ****
--- 886,894 ----
  			totalc = dir_copy(Conn,svdata,tc,cachefp,ruser,host,port,path,FORM_HTML,0);
  			}
  		}else{
+ 			if( 0 < Conn->sv.p_range[2] ){
+ 				size = Conn->sv.p_range[2];
+ 			}else
  			size = FTP_datasize(resp);
  			totalc = ident_copy(Conn,svdata,tc,cachefp,DGserv(),path,size,0);
  

  admin search upper oldest olders older1 this newer1 newers latest
[Top/Up] [oldest] - [Older+chunk] - [Newer+chunk] - [newest + Check]
@_@V