Article delegate-en/4037 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:<_A4036@delegate-en.ML_>]
Newsgroups: mail-lists.delegate-en

[DeleGate-En] Re: NNTP-Delegate will not cache in Linux
02 Aug 2008 23:22:52 GMT feedback@delegate.org (Yutaka Sato)
The DeleGate Project


Hi Jeff,

In message <_A4036@delegate-en.ML_> on 08/03/08(05:02:46)
you Jeff <pyqhqbdyi-cv6iw6rlawdr.ml@ml.delegate.org> wrote:
 |I have been struggling for a week now with NNTP-Delegate. Everything works
 |great and as expected except for caching. It just does not seem to work. I
 |have tested under Fedora and a new version of Kubuntu Linux. Under the
 |assumption that delegated is written for Unix primarily, I can't understand
 |why it does not work..

Thank you for your information.
I tested a caching NNTP proxy by DeleGate on Fedora and saw a cached
article never reused.  In my case I saw a error message in LOGFILE as
"#### malformed article file".

 |So I'm putting it down to a platform specific problem.

It seems the problem depeding on OS where fseek() and lseek() is not
synchronized.  It caused "malformed article" file with "\0" added on
its end in this case.  It will be fixed as the enclosed patch.

Cheers,
Yutaka
--
  9 9   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


*** dist/src/delegate9.8.4-pre3/rary/setutimes.c	Thu May 15 16:54:02 2008
--- rary/setutimes.c	Sun Aug  3 08:05:49 2008
***************
*** 111,116 ****
--- 111,124 ----
  	Fgetpos(fp,&savoff);
  	fseek(fp,offset,whence);
  	siz = Lseek(fileno(fp),offset,whence);
+ 	if( siz <= 0xFFFFFFFF ){
+ 		int fsiz = ftell(fp);
+ 		if( siz != fsiz ){
+ 			syslog_ERROR("## Ftruncate(%d,%lld,%d) %d %lld\n",
+ 				fileno(fp),offset,whence,fsiz,siz);
+ 			siz = fsiz;
+ 		}
+ 	}
  	rcode = ftruncate(fileno(fp),siz);
  	Fsetpos(fp,&savoff);
  	return rcode;

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