#!/bin/sh
# This is a shell archive (produced by GNU sharutils 4.1).
# To extract the files from this archive, save it to some FILE, remove
# everything before the `!/bin/sh' line above, then type `sh FILE'.
#
# Made on 1995-04-06 12:12 MDT by <hardy@powell>.
# Source directory was `/tmp_mnt/home/powell/hardy/pad'.
#
# Existing files will *not* be overwritten unless `-c' is specified.
# This format requires very little intelligence at unshar time.
# "if test", "echo", and "sed" may be needed.
#
# This shar contains:
# length mode       name
# ------ ---------- ------------------------------------------
#    572 -rw-r--r-- README
#   3011 -rw-r--r-- HTAccess.c.patch
#   1545 -rw-r--r-- HTTP.c.patch
#    979 -rw-r--r-- gui-documents.c.patch
#
# ============= README ==============
if test -f 'README' && test X"$1" != X"-c"; then
  echo 'x - skipping README (file already exists)'
else
  echo 'x - extracting README (text)'
  sed 's/^X//' << 'SHAR_EOF' > 'README' &&
X
XIn this directory you will find three patch files for Mosaic 2.4
Ximplementing
X
X	* no_proxy environment variable preventing proxy use for a
X	  given domain, e.g.
X
X		setenv no_proxy cern.ch
X
X	* pressing "Reload" causes Mosaic to send the no-cache pragma
X	  to proxy server, forcing it to refresh its cache.
X
XPrecompiled binaries are for SunOS 4.1.3, with and without -lresolv,
Xcompiled with direct WAIS support.
X
XNote, that I do not guarantee any further support for this, it is up
Xto NCSA to roll this support into the official version.
X
XAri Luotonen, CERN, May 12, 1994
X
SHAR_EOF
  : || echo 'restore of README failed'
fi
# ============= HTAccess.c.patch ==============
if test -f 'HTAccess.c.patch' && test X"$1" != X"-c"; then
  echo 'x - skipping HTAccess.c.patch (file already exists)'
else
  echo 'x - extracting HTAccess.c.patch (text)'
  sed 's/^X//' << 'SHAR_EOF' > 'HTAccess.c.patch' &&
X*** HTAccess.c.ORIG	Thu May 12 14:18:55 1994
X--- HTAccess.c	Thu May 12 14:25:36 1994
X***************
X*** 108,113 ****
X--- 108,192 ----
X  }
X  
X  
X+ /*							override_proxy()
X+ **
X+ **	Check the no_proxy environment variable to get the list
X+ **	of hosts for which proxy server is not consulted.
X+ **
X+ **	no_proxy is a comma- or space-separated list of machine
X+ **	or domain names, with optional :port part.  If no :port
X+ **	part is present, it applies to all ports on that domain.
X+ **
X+ **	Example:
X+ **		no_proxy="cern.ch,some.domain:8001"
X+ **
X+ */
X+ PRIVATE BOOL override_proxy ARGS1(CONST char *, addr)
X+ {
X+     CONST char * no_proxy = getenv("no_proxy");
X+     char * p = NULL;
X+     char * host = NULL;
X+     int port = 0;
X+     int h_len = 0;
X+ 
X+     if (!no_proxy || !addr || !(host = HTParse(addr, "", PARSE_HOST)))
X+ 	return NO;
X+     if (!*host) { free(host); return NO; }
X+ 
X+     if (p = strchr(host, ':')) {	/* Port specified */
X+ 	*p++ = 0;			/* Chop off port */
X+ 	port = atoi(p);
X+     }
X+     else {				/* Use default port */
X+ 	char * access = HTParse(addr, "", PARSE_ACCESS);
X+ 	if (access) {
X+ 	    if	    (!strcmp(access,"http"))	port = 80;
X+ 	    else if (!strcmp(access,"gopher"))	port = 70;
X+ 	    else if (!strcmp(access,"ftp"))	port = 21;
X+ 	    free(access);
X+ 	}
X+     }
X+     if (!port) port = 80;		/* Default */
X+     h_len = strlen(host);
X+ 
X+     while (*no_proxy) {
X+ 	CONST char * end;
X+ 	CONST char * colon = NULL;
X+ 	int templ_port = 0;
X+ 	int t_len;
X+ 
X+ 	while (*no_proxy && (WHITE(*no_proxy) || *no_proxy==','))
X+ 	    no_proxy++;			/* Skip whitespace and separators */
X+ 
X+ 	end = no_proxy;
X+ 	while (*end && !WHITE(*end) && *end != ',') {	/* Find separator */
X+ 	    if (*end==':') colon = end;			/* Port number given */
X+ 	    end++;
X+ 	}
X+ 
X+ 	if (colon) {
X+ 	    templ_port = atoi(colon+1);
X+ 	    t_len = colon - no_proxy;
X+ 	}
X+ 	else {
X+ 	    t_len = end - no_proxy;
X+ 	}
X+ 
X+ 	if ((!templ_port || templ_port == port)  &&
X+ 	    (t_len > 0  &&  t_len <= h_len  &&
X+ 	     !strncmp(host + h_len - t_len, no_proxy, t_len))) {
X+ 	    free(host);
X+ 	    return YES;
X+ 	}
X+ 	if (*end) no_proxy = end+1;
X+ 	else break;
X+     }
X+ 
X+     free(host);
X+     return NO;
X+ }
X+ 
X+ 
X  /*		Find physical name and access protocol
X  **		--------------------------------------
X  **
X***************
X*** 137,143 ****
X  */
X  #define USE_GATEWAYS
X  #ifdef USE_GATEWAYS
X!     {
X  	char *gateway_parameter, *gateway, *proxy;
X  
X  	/* search for gateways */
X--- 216,226 ----
X  */
X  #define USE_GATEWAYS
X  #ifdef USE_GATEWAYS
X! 
X!     /* make sure the using_proxy variable is false */
X!     using_proxy = NO;
X! 
X!     if (!override_proxy(addr)) {
X  	char *gateway_parameter, *gateway, *proxy;
X  
X  	/* search for gateways */
X***************
X*** 168,176 ****
X  	    gateway = DEFAULT_WAIS_GATEWAY;
X  	}
X  #endif
X- 
X- 	/* make sure the using_proxy variable is false */
X- 	using_proxy = NO;
X  
X  	/* proxy servers have precedence over gateway servers */
X  	if (proxy) {
X--- 251,256 ----
SHAR_EOF
  : || echo 'restore of HTAccess.c.patch failed'
fi
# ============= HTTP.c.patch ==============
if test -f 'HTTP.c.patch' && test X"$1" != X"-c"; then
  echo 'x - skipping HTTP.c.patch (file already exists)'
else
  echo 'x - extracting HTTP.c.patch (text)'
  sed 's/^X//' << 'SHAR_EOF' > 'HTTP.c.patch' &&
X*** HTTP.c.ORIG	Thu May 12 13:25:33 1994
X--- HTTP.c	Thu May 12 13:34:09 1994
X***************
X*** 40,46 ****
X  char *post_data = NULL;
X  extern BOOL using_gateway;    /* are we using an HTTP gateway? */
X  extern BOOL using_proxy;      /* are we using an HTTP proxy gateway? */
X! 
X  
X  /*		Load Document from HTTP Server			HTLoadHTTP()
X  **		==============================
X--- 40,46 ----
X  char *post_data = NULL;
X  extern BOOL using_gateway;    /* are we using an HTTP gateway? */
X  extern BOOL using_proxy;      /* are we using an HTTP proxy gateway? */
X! PUBLIC BOOL reloading = NO;   /* reloading => send no-cache pragma to proxy */
X  
X  /*		Load Document from HTTP Server			HTLoadHTTP()
X  **		==============================
X***************
X*** 195,201 ****
X                StrAllocCat(command, line);
X              }
X          }
X!       
X        sprintf(line, "User-Agent:  %s/%s  libwww/%s%c%c",
X                HTAppName ? HTAppName : "unknown",
X                HTAppVersion ? HTAppVersion : "0.0",
X--- 195,210 ----
X                StrAllocCat(command, line);
X              }
X          }
X! 
X!       /*
X!        * When reloading give no-cache pragma to proxy server to make
X!        * it refresh its cache. -- Ari L. <luotonen@dxcern.cern.ch>
X!        */
X!       if (reloading) {
X! 	  sprintf(line, "Pragma: no-cache%c%c", CR, LF);
X! 	  StrAllocCat(command, line);
X!       }
X! 
X        sprintf(line, "User-Agent:  %s/%s  libwww/%s%c%c",
X                HTAppName ? HTAppName : "unknown",
X                HTAppVersion ? HTAppVersion : "0.0",
SHAR_EOF
  : || echo 'restore of HTTP.c.patch failed'
fi
# ============= gui-documents.c.patch ==============
if test -f 'gui-documents.c.patch' && test X"$1" != X"-c"; then
  echo 'x - skipping gui-documents.c.patch (file already exists)'
else
  echo 'x - extracting gui-documents.c.patch (text)'
  sed 's/^X//' << 'SHAR_EOF' > 'gui-documents.c.patch' &&
X*** gui-documents.c.ORIG	Mon Apr 11 20:58:02 1994
X--- gui-documents.c	Thu May 12 14:13:11 1994
X***************
X*** 487,494 ****
X  	post_gave_encrypt = 0;
X  #endif /* PEM_AUTH */
X  
X!   win->current_node->text = mo_pull_er_over (win->current_node->url, 
X!                                              &win->current_node->texthead);
X    {
X      /* Check use_this_url_instead from HTAccess.c. */
X      /* IS THIS GOOD ENOUGH FOR THIS CASE??? */
X--- 487,503 ----
X  	post_gave_encrypt = 0;
X  #endif /* PEM_AUTH */
X  
X!   {
X!       /*
X!        * Reload should force a cache refresh on a proxy
X!        *	-- Ari L. <luotonen@dxcern.cern.ch>
X!        */
X!       extern char reloading;	/* is really a BOOL */
X!       reloading = 1;
X!       win->current_node->text = mo_pull_er_over (win->current_node->url, 
X! 						 &win->current_node->texthead);
X!       reloading = 0;
X!   }
X    {
X      /* Check use_this_url_instead from HTAccess.c. */
X      /* IS THIS GOOD ENOUGH FOR THIS CASE??? */
SHAR_EOF
  : || echo 'restore of gui-documents.c.patch failed'
fi
exit 0
