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

[DeleGate-En] Re: NNTP-Delegate will not cache in Linux
05 Aug 2008 10:09:19 GMT feedback@delegate.org (Yutaka Sato)
The DeleGate Project


Hi,

In message <_A4047@delegate-en.ML_> on 08/05/08(17:45:31)
you Jeff <pyqhqbdyi-ry4zqcomjzvr.ml@ml.delegate.org> wrote:
 |I have tested after making the patch you suggested for the ARTICLE/BODY
 |problem and it works perfectly. The articles are now caching and everything
 |is working great. Thanks again for your time and help, I really appreciate
 |it. Will it be safe to assume these changes will be incorporated in your
 |main releases or will I need to use my patched versions from here onwards?

The modifications will be included in the next release (9.8.4-pre4).

 |Regarding the "other NNTP clients", I was referring to the software that
 |users on my network are using to download via NNTP namely Newsleecher,
 |Grabit, Alt.binz etc

I see.

 |Lastly, some users on my network require RADIUS authentication (supported by
 |my feed provider). For this to work properly, I need to be able to insert a
 |domain identifier so that the origin server forwards RADIUS packets
 |correctly. Essentially, all that delegate needs to do is modify the AUTHINFO
 |command as follows:
 |AUTHINFO USER username -> AUTHINFO USER username@domain
 |Since the @domain part is static, it can be inserted by delegate using
 |strcat(user,"@domain") on each request
 |
 |I have tried to patch it myself with little success :( Perhaps it could be
 |added as a parameter i.e. RADIUS-DOMAIN=@domainname - although I would not
 |mind hard coding it into the source code if needed since this is a special
 |one-time request.
 |
 |I don't want to use more of your time but if you could maybe assist me with
 |some patch code as before, that would be very useful.

Note that users except commercial licensee have no right to make their
own modification to DeleGate.  (and you are not one as long as I know :).

The enclosed patch is a tentative code for rewriting the NNTP command
using a MOUNT parameter.  It is used as this:

  MOUNT="command:AUTHINFO/USER*%S data:;,AUTHINFO/USER*%S@domain nocase"

You will see the message about the rewriting in the LOGFILE as this:

  1+0: *** command:authinfo/user%20useri => data:;,AUTHINFO/USER%20useri@domain ***
  1+0: ##CM [AUTHINFO][USER useri]->[AUTHINFO][USER useri@domain]

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/src/nntp.c	Mon Nov  5 17:11:16 2007
--- nntp.c	Tue Aug  5 18:57:00 2008
***************
*** 44,49 ****
--- 44,81 ----
  #include "file.h"
  #include "auth.h"
  
+ int commandMount(Connection *Conn,PVStr(req),PVStr(com),PVStr(arg)){
+ 	const char *opts;
+ 	IStr(xreq,1024);
+ 	IStr(crlf,8);
+ 	refQStr(xp,xreq);
+ 	IStr(xcom,128);
+ 	IStr(xarg,1024);
+ 
+ 	sprintf(xreq,"command:%s/%s",com,arg);
+ 	if( xp = strpbrk(xreq,"\r\n") ){
+ 		strcpy(crlf,xp);
+ 		clearVStr(xp);
+ 	}
+ 
+ 	strsubst(AVStr(xreq)," ","%20");
+ 	opts = CTX_mount_url_to(Conn,"",com,AVStr(xreq));
+ 	if( opts == 0 )
+ 		return 0;
+ 
+ 	if( strneq(xreq,"data:;,",7) ){
+ 		strsubst(AVStr(xreq),"%20"," ");
+ 		Xsscanf(xreq+7,"%[^/]/%[^\r\n]",AVStr(xcom),AVStr(xarg));
+ 		if( xcom[0] ){
+ 			sv1log("##CM [%s][%s]->[%s][%s]\n",com,arg,xcom,xarg);
+ 			strcpy(com,xcom);
+ 			strcpy(arg,xarg);
+ 			sprintf(req,"%s %s%s",xcom,xarg,crlf);
+ 			return 1;
+ 		}
+ 	}
+ 	return 0;
+ }
  static void RecvMssg(FILE *fs,FILE *afp,int withEOR){
  	recvMssg(fs,afp,withEOR);
  }
***************
*** 4478,4483 ****
--- 4510,4518 ----
  		if( dp = wordScan(ReqBuf,com) )
  			lineScan(dp,arg);
  		else	arg[0] = 0;
+ 		if( 1 ){
+ 			commandMount(Conn,AVStr(ReqBuf),AVStr(com),AVStr(arg));
+ 		}
  
  		if( !ImCC && nservers_active(1) == 1 )
  		if( PENALTY_SLEEP )

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