tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mt...@apache.org
Subject svn commit: r378858 - in /tomcat/connectors/trunk: jni/native/src/network.c util/java/org/apache/tomcat/util/net/AprEndpoint.java
Date Sun, 19 Feb 2006 08:43:25 GMT
Author: mturk
Date: Sun Feb 19 00:43:23 2006
New Revision: 378858

URL: http://svn.apache.org/viewcvs?rev=378858&view=rev
Log:
Revert checking for sendfile support in bean getter,
but keep the default value for useSendfile depending
on APR support, so that there is no unneeded warning.
Also create a dummy JNI implementation returning
APR_ENOTIMPL, so that library link don't report errors.

Modified:
    tomcat/connectors/trunk/jni/native/src/network.c
    tomcat/connectors/trunk/util/java/org/apache/tomcat/util/net/AprEndpoint.java

Modified: tomcat/connectors/trunk/jni/native/src/network.c
URL: http://svn.apache.org/viewcvs/tomcat/connectors/trunk/jni/native/src/network.c?rev=378858&r1=378857&r2=378858&view=diff
==============================================================================
--- tomcat/connectors/trunk/jni/native/src/network.c (original)
+++ tomcat/connectors/trunk/jni/native/src/network.c Sun Feb 19 00:43:23 2006
@@ -1103,6 +1103,7 @@
     return mark ? JNI_TRUE : JNI_FALSE;
 }
 
+#if APR_HAS_SENDFILE
 
 TCN_IMPLEMENT_CALL(jlong, Socket, sendfile)(TCN_STDARGS, jlong sock,
                                             jlong file,
@@ -1226,6 +1227,44 @@
         return -(jlong)ss;
     }
 }
+
+#else /* APR_HAS_SENDIFLE */
+
+TCN_IMPLEMENT_CALL(jlong, Socket, sendfile)(TCN_STDARGS, jlong sock,
+                                            jlong file,
+                                            jobjectArray headers,
+                                            jobjectArray trailers,
+                                            jlong offset, jlong len,
+                                            jint flags)
+{
+
+    UNREFERENCED_STDARGS;
+    UNREFERENCED(sock);
+    UNREFERENCED(file);
+    UNREFERENCED(headers);
+    UNREFERENCED(trailers);
+    UNREFERENCED(offset);
+    UNREFERENCED(len);
+    UNREFERENCED(flags);
+    return -(jlong)APR_ENOTIMPL;
+}
+
+TCN_IMPLEMENT_CALL(jlong, Socket, sendfilen)(TCN_STDARGS, jlong sock,
+                                             jlong file,
+                                             jlong offset, jlong len,
+                                             jint flags)
+{
+    UNREFERENCED_STDARGS;
+    UNREFERENCED(sock);
+    UNREFERENCED(file);
+    UNREFERENCED(offset);
+    UNREFERENCED(len);
+    UNREFERENCED(flags);
+    return -(jlong)APR_ENOTIMPL;
+}
+
+#endif  /* APR_HAS_SENDIFLE */
+
 
 TCN_IMPLEMENT_CALL(jint, Socket, acceptfilter)(TCN_STDARGS,
                                                jlong sock,

Modified: tomcat/connectors/trunk/util/java/org/apache/tomcat/util/net/AprEndpoint.java
URL: http://svn.apache.org/viewcvs/tomcat/connectors/trunk/util/java/org/apache/tomcat/util/net/AprEndpoint.java?rev=378858&r1=378857&r2=378858&view=diff
==============================================================================
--- tomcat/connectors/trunk/util/java/org/apache/tomcat/util/net/AprEndpoint.java (original)
+++ tomcat/connectors/trunk/util/java/org/apache/tomcat/util/net/AprEndpoint.java Sun Feb
19 00:43:23 2006
@@ -306,9 +306,9 @@
     /**
      * Use endfile for sending static files.
      */
-    protected boolean useSendfile = true;
+    protected boolean useSendfile = Library.APR_HAS_SENDFILE;
     public void setUseSendfile(boolean useSendfile) { this.useSendfile = useSendfile; }
-    public boolean getUseSendfile() { return Library.APR_HAS_SENDFILE ? useSendfile : false;
}
+    public boolean getUseSendfile() { return useSendfile; }
 
 
     /**



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


Mime
View raw message