]> granicus.if.org Git - apache/commitdiff
Turn on buffering for config file reads. This is dependent on ap_fgets()
authorJeff Trawick <trawick@apache.org>
Fri, 16 Jun 2000 16:41:21 +0000 (16:41 +0000)
committerJeff Trawick <trawick@apache.org>
Fri, 16 Jun 2000 16:41:21 +0000 (16:41 +0000)
doing the right thing.

Brian Havard implemented buffering for ap_fgets() on Win32 recently; OS/2 had
it already.  This provides it for Unix.

changes to ap_read(), ap_getc(), ap_fgets() for Unix:

1) this fixes a problem in where ap_open() where a lock is created for
   non-buffered files
2) this fixes problems setting rv correctly in the ap_read() buffered
   path
3) since ap_read() works as expected, it is possible to make ap_getc()
   and ap_fgets() even smaller
4) ap_fgets() no longer cares about '\r'

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@85586 13f79535-47bb-0310-9956-ffa450edef68

server/util.c

index 4ac6f7db9edb3fdf53ddc91920a41d8b1219144f..daa4227e3df4ba55b56f9b499d3fa519e5c377f1 100644 (file)
@@ -874,7 +874,7 @@ API_EXPORT(ap_status_t) ap_pcfg_openfile(configfile_t **ret_cfg, ap_pool_t *p, c
         return APR_EACCES;
     }
 
-    status = ap_open(&file, name, APR_READ, APR_OS_DEFAULT, p);
+    status = ap_open(&file, name, APR_READ | APR_BUFFERED, APR_OS_DEFAULT, p);
 #ifdef DEBUG
     ap_log_error(APLOG_MARK, APLOG_DEBUG | APLOG_NOERRNO, NULL,
                 "Opening config file %s (%s)",