httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrew Hanson <han...@europa.com>
Subject Re: Apache proxy problem on NT4.0 (fwd)
Date Fri, 05 Dec 1997 22:03:38 GMT
Here is a snippet of code that I had to use to make the proxy work on 95 
/ NT
its slimy but works

because  sub_canonical_filename() will add the root path to a proxy 
request.
aka . "proxy:http://www.whatever.com/" becomes 
"c:\apache\proxy:http://www.whatever.com/" which is an invalid proxy 
request.

in util_win32.c
line 55

API_EXPORT(char *) os_canonical_filename(pool *pPool,const char *szFile)
{
    char buf[BUF_MAX_PATH];
  char *tstr;
 int len;
 char tmpstr[10];

 /*Do Nothing if we are a proxy */
 len = strlen(szFile);
 if (len > 6) {

  memmove(tmpstr, szFile, 6);
  tmpstr[6] = 0;
  strlwr(tmpstr);
  if (strcmp(tmpstr, "proxy:") == 0) {
   strcpy(buf, szFile);
  strlwr(buf);
   return pstrdup(pPool, buf);
  }
 }
    sub_canonical_filename(buf,szFile);
 tstr = buf;

/* heres an unneeded (but heathly) hack */
 while (*tstr != 0) {
  if (*tstr == '\\')
   *tstr = '/';
  tstr++;
 }
  strlwr(buf);
  return pstrdup(pPool, buf);
}


,Andrew

Mime
View raw message