--- java/org/apache/coyote/http11/Http11AprProtocol.java +++ java/org/apache/coyote/http11/Http11AprProtocol.java @@ -245,6 +245,9 @@ public int getSendfileSize() { return endpoint.getSendfileSize(); } public void setSendfileSize(int sendfileSize) { endpoint.setSendfileSize(sendfileSize); } + public boolean getDeferAccept() { return endpoint.getDeferAccept(); } + public void setDeferAccept(boolean deferAccept) { endpoint.setDeferAccept(deferAccept); } + protected int socketBuffer = 9000; public int getSocketBuffer() { return socketBuffer; } public void setSocketBuffer(int socketBuffer) { this.socketBuffer = socketBuffer; } --- java/org/apache/tomcat/util/net/AprEndpoint.java +++ java/org/apache/tomcat/util/net/AprEndpoint.java @@ -156,15 +156,17 @@ protected long sslContext = 0; + // ------------------------------------------------------------- Properties + + /** * Defer accept. */ protected boolean deferAccept = true; - + public void setDeferAccept(boolean deferAccept) { this.deferAccept = deferAccept; } + public boolean getDeferAccept() { return deferAccept; } - // ------------------------------------------------------------- Properties - /** * External Executor based thread pool. */ @@ -659,8 +661,10 @@ // Delay accepting of new connections until data is available // Only Linux kernels 2.4 + have that implemented // on other platforms this call is noop and will return APR_ENOTIMPL. - if (Socket.optSet(serverSock, Socket.APR_TCP_DEFER_ACCEPT, 1) == Status.APR_ENOTIMPL) { - deferAccept = false; + if (deferAccept) { + if (Socket.optSet(serverSock, Socket.APR_TCP_DEFER_ACCEPT, 1) == Status.APR_ENOTIMPL) { + deferAccept = false; + } } // Initialize SSL if needed