httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Garey Smiley" <ga...@slink.com>
Subject OS/2 proxy fix.
Date Wed, 24 Sep 1997 13:58:54 GMT
Here's a fix for the proxy under OS/2. I think this patch may also be needed on other platforms.
Basically the issue is doing an open() against a directory name. This will always fail under
OS/2 causing garbage collection to never be completed. I belive this code should work under
any os eliminating the need for an OS/2 specific section. Any thoughts?


*** proxy_cache.c.orig	Fri Aug 15 10:08:54 1997
--- proxy_cache.c	Sun Sep  7 15:37:00 1997
***************
*** 243,267 ****
--- 243,275 ----
      /* FIXME: Shouldn't any unexpected files be deleted? */
      /*  if (strlen(ent->d_name) != HASH_LEN) continue; */
  
  /* read the file */
+ #ifndef __EMX__
      fd = open(filename, O_RDONLY);
      if (fd == -1)
      {
          if (errno  != ENOENT) proxy_log_uerror("open", filename,NULL,
          r->server);
          continue;
      }
      if (fstat(fd, &buf) == -1)
+ #else
+     if (stat(filename, &buf) == -1)
+ #endif
      {
          proxy_log_uerror("fstat", filename, NULL, r->server);
+ #ifndef __EMX__
          close(fd);
+ #endif
          continue;
      }
      if(S_ISDIR(buf.st_mode))
          {
          char newcachedir[HUGE_STRING_LEN];
+ #ifndef __EMX__
          close(fd);
+ #endif
          ap_snprintf(newcachedir, sizeof(newcachedir),
          "%s%s/",cachesubdir,ent->d_name);
          if(!sub_garbage_coll(r,files,cachebasedir,newcachedir))
          {
***************
*** 276,283 ****
--- 284,303 ----
          }
          continue;
          }
  
+ #ifdef __EMX__
+         /* this IS a real file */
+ 
+         fd = open(filename, O_RDONLY);
+         if (fd == -1)
+         {
+             if (errno  != ENOENT) proxy_log_uerror("open", filename,NULL,
+                 r->server);
+             continue;
+         }
+ #endif
+ 
      i = read(fd, line, 26);
      if (i == -1)
      {
          proxy_log_uerror("read", filename, NULL, r->server);


Garey Smiley
SoftLink Services
garey@slink.com
http://www.slink.com/
(330)848-1312 FAX/Data(330)699-4474

Mime
View raw message