file://localhost => local: ?

Larry Masinter <masinter@parc.xerox.com>
Errors-To: listmaster@www0.cern.ch
Date: Mon, 21 Mar 1994 19:14:36 --100
Message-id: <94Mar21.101133pst.2732@golden.parc.xerox.com>
Errors-To: listmaster@www0.cern.ch
Reply-To: masinter@parc.xerox.com
Originator: www-talk@info.cern.ch
Sender: www-talk@www0.cern.ch
Precedence: bulk
From: Larry Masinter <masinter@parc.xerox.com>
To: Multiple recipients of list <www-talk@www0.cern.ch>
Subject: file://localhost  =>  local: ?
X-Listprocessor-Version: 6.0c -- ListProcessor by Anastasios Kotsikonas
Content-Length: 3090
I noticed a couple of problems with using the proxy caching gateway
from CERN. One was that I was getting core dumps. I tracked this down
some uninitialized pointers; I sent a patch to mosaic-x, but in case
others of you were trying to use Mosaic-2.2 with proxy, you might want
the patches I enclose at the end of this message.

Another more serious problem is that many HTML documents on the net
still use 'file:' instead of 'ftp:'. To get this to work with the
proxy gateway, I set things up so that 

setenv file_proxy = http://myserver:/

and then set up the httpd.conf on the server so that:
	Pass	file:*	ftp:*

This seems to work fine for dealing with these 'obsolete' URLs, except
for those folks who want to use file: to refer to local files on their
own machine.

Personally, I'd like to see a totally different URL constructed to
mean 'file on the client's workstation' for use with lynx, Mosaic,
etc. to get rid of the ambiguity. I propose using:

	local:<local-host-pathname>

What do you think?

================================================================
Date: Sun, 20 Mar 94 17:23:38 EST
To: mosaic-x@ncsa.uiuc.edu
Subject: memory errors
From: Larry Masinter <masinter@parc.xerox.com>

After fidding with purify for a while, I found something that might be
causing the core dumps when using proxy gateways: most of the memory
management routines like StrAllocCopy etc. seem to not want
uninitialized pointers (they free them.)

These seem to fix the problem:

================================================================
in libwww2/HTAccess.c
================================================================
*** HTAccess.c.~1~	Tue Feb  8 13:20:55 1994
--- HTAccess.c	Sun Mar 20 16:48:47 1994
***************
*** 138,144 ****
  #define USE_GATEWAYS
  #ifdef USE_GATEWAYS
      {
! 	char *gateway_parameter, *gateway, *proxy;
  
  	/* search for gateways */
  	gateway_parameter = (char *)malloc(strlen(access)+20);
--- 138,144 ----
  #define USE_GATEWAYS
  #ifdef USE_GATEWAYS
      {
! 	char *gateway_parameter = 0, *gateway = 0, *proxy = 0;
  
  	/* search for gateways */
  	gateway_parameter = (char *)malloc(strlen(access)+20);
***************
*** 174,180 ****
  
  	/* proxy servers have precedence over gateway servers */
  	if (proxy) {
! 		char * gatewayed;
  		StrAllocCopy(gatewayed,proxy);
  		StrAllocCat(gatewayed,addr);
  		using_proxy = YES;
--- 174,180 ----
  
  	/* proxy servers have precedence over gateway servers */
  	if (proxy) {
! 		char * gatewayed = 0;
  		StrAllocCopy(gatewayed,proxy);
  		StrAllocCat(gatewayed,addr);
  		using_proxy = YES;
***************
*** 185,191 ****
  		access =  HTParse(HTAnchor_physical(anchor),
  			"http:", PARSE_ACCESS);
  	} else if (gateway) {
! 		char * gatewayed;
  		StrAllocCopy(gatewayed,gateway);
  		StrAllocCat(gatewayed,addr);
  		using_gateway = YES;
--- 185,191 ----
  		access =  HTParse(HTAnchor_physical(anchor),
  			"http:", PARSE_ACCESS);
  	} else if (gateway) {
! 		char * gatewayed = 0;
  		StrAllocCopy(gatewayed,gateway);
  		StrAllocCat(gatewayed,addr);
  		using_gateway = YES;