tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r...@apache.org
Subject cvs commit: jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net AprEndpoint.java
Date Sat, 14 May 2005 15:42:30 GMT
remm        2005/05/14 08:42:30

  Modified:    util/java/org/apache/tomcat/util/net/res
                        LocalStrings.properties
               util/java/org/apache/tomcat/util/net AprEndpoint.java
  Log:
  - Disable sendfile if not supported, as submitted by Bill and Mladen.
  
  Revision  Changes    Path
  1.9       +1 -0      jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net/res/LocalStrings.properties
  
  Index: LocalStrings.properties
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net/res/LocalStrings.properties,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- LocalStrings.properties	3 May 2005 09:36:58 -0000	1.8
  +++ LocalStrings.properties	14 May 2005 15:42:30 -0000	1.9
  @@ -19,3 +19,4 @@
   endpoint.poll.error=Unexpected poller error
   endpoint.sendfile.error=Unexpected sendfile error
   endpoint.sendfile.addfail=Sednfile failure with status {0}
  +endpoint.sendfile.nosupport=Disabling sendfile, since either the APR version or the system
doesn't support it
  
  
  
  1.26      +7 -0      jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net/AprEndpoint.java
  
  Index: AprEndpoint.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net/AprEndpoint.java,v
  retrieving revision 1.25
  retrieving revision 1.26
  diff -u -r1.25 -r1.26
  --- AprEndpoint.java	11 May 2005 11:23:26 -0000	1.25
  +++ AprEndpoint.java	14 May 2005 15:42:30 -0000	1.26
  @@ -26,6 +26,7 @@
   import org.apache.tomcat.jni.Address;
   import org.apache.tomcat.jni.Error;
   import org.apache.tomcat.jni.File;
  +import org.apache.tomcat.jni.Library;
   import org.apache.tomcat.jni.Poll;
   import org.apache.tomcat.jni.Pool;
   import org.apache.tomcat.jni.Socket;
  @@ -396,6 +397,12 @@
           Socket.bind(serverSock, inetAddress);
           // Start listening on the server socket
           Socket.listen(serverSock, backlog);
  +        
  +        // Sendfile usage on systems which don't support it cause major problems
  +        if (useSendfile && !Library.APR_HAS_SENDFILE) {
  +            log.warn(sm.getString("endpoint.sendfile.nosupport"));
  +            useSendfile = false;
  +        } 
   
           initialized = true;
   
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org


Mime
View raw message