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

[DeleGate-En] Re: BASEURL adds extra / into URL ?
10 Nov 2000 04:05:47 GMT ysato@etl.go.jp (Yutaka Sato)


Hi,

On 11/10/00(02:11) you "Jari Ahonen" <ptmbqbdyi-puniz7fmro5r.ml@ml.delegate.org> wrote
in <_A923@delegate-en.ML_>
 |Client - DeleGate - Server
 |MOUNT /foobar/* http://server/*
 |
 |If there is no BASEURL in the configuration, DeleGate rewrites
 |the redirect like this:
 |http://server/xyz/ -> http://192.168.168.1/foobar/xyz/

Maybe this problem is caused because the IP-address which is used by
a client to reach your host (network interface card on your host)
like "192.168.168.1" cannot be resolved into any hostname like
"delegatehost" on your host.  If this is the case, you will find
a line in your LOGFILE as follows

  PATH> http://server:80!192.168.168.1:80!client-host:port!...

instead of

  PATH> http://server:80!delegatehost:80!client-host:port!...

This problem can be solved by setting the necessary reverse
resolution data on you host, or simply add a parameter to DeleGate
like follows.

  HOSTS=delegatehost/192.168.168.1

Solving this problem without BASEURL is desireble not to generate
useless full URL like "HREF=http://delegate/xxx" but to embed
relative URL like "HREF=/xxx".

 |This is fine but I don't want to use IP addresses in URLs so
 |I add a BASEURL="http://delegatehost" into the config. In this
 |case the URL gets rewritten like this:
 |http://server/xyz/ -> http://delegatehost//foobar/xyz/
 |
 |Note the two slashes after hostname part.

This behavior of BASEURL is another problem which must be
solved by me :)
The enclosed patch will fix it.

Cheers,
Yutaka
--
Yutaka Sato <ysato@etl.go.jp> http://www.etl.go.jp/~ysato/   @ @ 
Computer Science Division, Electrotechnical Laboratory      ( - )
1-1-4 Umezono, Tsukuba, Ibaraki, 305-8568 Japan            _<   >_


diff -cr 1109/src/ddi.c ./src/ddi.c
*** 1109/src/ddi.c	Mon Oct 16 20:58:29 2000
--- ./src/ddi.c	Fri Nov 10 12:54:46 2000
***************
*** 805,811 ****
--- 805,814 ----
  	Verbose("BASEURL=%s\n",url);
  	if( isFullURL(url) ){
  		path[0] = '/';
+ /*
  		decomp_absurl(url,proto,site,path+1,sizeof(path)-1);
+ */
+ 		decomp_absurl(url,proto,site,path,sizeof(path));
  		decomp_URL_site(site,host,sport);
  		if( *sport )
  			port = atoi(sport);
diff -cr 1109/src/url.c ./src/url.c
*** 1109/src/url.c	Wed Oct 25 17:51:12 2000
--- ./src/url.c	Fri Nov 10 12:29:18 2000
***************
*** 1692,1697 ****
--- 1692,1700 ----
  			if( dproto && dproto[0] )
  				HostPort(hostport,dproto,dhost,dport);
  			else	sprintf(hostport,"%s:%d",dhost,dport);
+ 			if( *dpath != 0 && *dpath != '/' )
+ 			vp = Sprintf(vp,"delegate=%s/%s\n",hostport,dpath);
+ 			else
  			vp = Sprintf(vp,"delegate=%s%s\n",hostport,dpath);
  		}
  		if((tail = delegate_url(ctx,rurl,values,url,len,dgrelay)) == 0)

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