I did consider adding this to the AJP connector as well but since this is to work around a buggy client and we control the client in the AJP case, I couldn't see a need for it.
Patch provided by Michael Leinartas.
git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@708344
13f79535-47bb-0310-9956-
ffa450edef68
public void setSendfileThreadCount(int sendfileThreadCount) { endpoint.setSendfileThreadCount(sendfileThreadCount); }
public int getSendfileThreadCount() { return endpoint.getSendfileThreadCount(); }
-
+
+ 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; }
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.
*/
// 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
presented. The default value is infinite (i.e. no timeout).</p>
</attribute>
+ <attribute name="deferAccept" required="false">
+ <p>Sets the <code>TCP_DEFER_ACCEPT</code> flag on the listening socket for
+ this connector. The default value is <code>true</code> where
+ <code>TCP_DEFER_ACCEPT</code> is supported by the operating system,
+ otherwise it is <code>false</code>.</p>
+ </attribute>
+
<attribute name="executor" required="false">
<p>A reference to the name in an <a href="executor.html">Executor</a> element.
If this attribute is enabled, and the named executor exists, the connector will