httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bh...@gensym.com (Ben Hyde)
Subject performance tweak.
Date Tue, 11 Nov 1997 22:20:52 GMT

In default_handler, avoid the mmap call, if
we don't need the file's content.

Index: src/main/http_core.c
===================================================================
RCS file: /cvs/apachen/src/main/http_core.c,v
retrieving revision 1.135
diff -c -r1.135 http_core.c
*** http_core.c	1997/11/08 21:42:36	1.135
--- http_core.c	1997/11/11 22:15:14
***************
*** 1744,1752 ****
  
  #ifdef USE_MMAP_FILES
      block_alarms();
!     if (r->finfo.st_size >= MMAP_THRESHOLD) {
! 	/* we need to protect ourselves in case we die while we've got the
! 	 * file mmapped */
  	mm = mmap (NULL, r->finfo.st_size, PROT_READ, MAP_PRIVATE,
  		    fileno(f), 0);
      } else {
--- 1744,1753 ----
  
  #ifdef USE_MMAP_FILES
      block_alarms();
!     if ((r->finfo.st_size >= MMAP_THRESHOLD)
! 	&& ( !r->header_only || (d->content_md5 & 1))) {
!       /* we need to protect ourselves in case we die while we've got the
!  	 * file mmapped */
  	mm = mmap (NULL, r->finfo.st_size, PROT_READ, MAP_PRIVATE,
  		    fileno(f), 0);
      } else {

Mime
View raw message