cvs commit: jakarta-tomcat-connectors/http11/src/java/org/apache/coyote/http11 Http11AprProtocol.java

2005-07-07 Thread remm
remm2005/07/07 06:38:38

  Modified:util/java/org/apache/tomcat/util/net AprEndpoint.java
   http11/src/java/org/apache/coyote/http11
Http11AprProtocol.java
  Log:
  - Add basic SSL support (no cert extraction yet).
  - Untested.
  
  Revision  ChangesPath
  1.58  +160 -37   
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.57
  retrieving revision 1.58
  diff -u -r1.57 -r1.58
  --- AprEndpoint.java  3 Jul 2005 10:12:51 -   1.57
  +++ AprEndpoint.java  7 Jul 2005 13:38:38 -   1.58
  @@ -31,10 +31,12 @@
   import org.apache.tomcat.jni.Pool;
   import org.apache.tomcat.jni.Socket;
   import org.apache.tomcat.jni.Status;
  +import org.apache.tomcat.jni.SSL;
  +import org.apache.tomcat.jni.SSLContext;
  +import org.apache.tomcat.jni.SSLSocket;
   import org.apache.tomcat.util.res.StringManager;
   import org.apache.tomcat.util.threads.ThreadWithAttributes;
   
  -
   /**
* APR tailored thread pool, providing the following services:
* ul
  @@ -149,6 +151,12 @@
*/
   protected long serverSockPool = 0;
   
  +
  +/**
  + * SSL context.
  + */
  +protected long sslContext = 0;
  +
   
   // - 
Properties
   
  @@ -205,7 +213,7 @@
* Handling of accepted sockets.
*/
   protected Handler handler = null;
  -public void setHandler(Handler handler ) { this.handler=handler; }
  +public void setHandler(Handler handler ) { this.handler = handler; }
   public Handler getHandler() { return handler; }
   
   
  @@ -325,7 +333,104 @@
*/
   public int getMinSpareThreads() { return 0; }
   
  +
  +/**
  + * SSL engine.
  + */
  +protected String SSLEngine = off;
  +public String getSSLEngine() { return SSLEngine; }
  +public void setSSLEngine(String SSLEngine) { this.SSLEngine = SSLEngine; 
}
  +
  +
  +/**
  + * SSL password (if a cert is encrypted, and no password has been 
provided, a callback
  + * will ask for a password).
  + */
  +protected String SSLPassword = null;
  +public String getSSLPassword() { return SSLPassword; }
  +public void setSSLPassword(String SSLPassword) { this.SSLPassword = 
SSLPassword; }
   
  +
  +/**
  + * SSL cipher suite.
  + */
  +protected String SSLCipherSuite = ALL;
  +public String getSSLCipherSuite() { return SSLCipherSuite; }
  +public void setSSLCipherSuite(String SSLCipherSuite) { 
this.SSLCipherSuite = SSLCipherSuite; }
  +
  +
  +/**
  + * SSL certificate file.
  + */
  +protected String SSLCertificateFile = null;
  +public String getSSLCertificateFile() { return SSLCertificateFile; }
  +public void setSSLCertificateFile(String SSLCertificateFile) { 
this.SSLCertificateFile = SSLCertificateFile; }
  +
  +
  +/**
  + * SSL certificate key file.
  + */
  +protected String SSLCertificateKeyFile = null;
  +public String getSSLCertificateKeyFile() { return SSLCertificateKeyFile; 
}
  +public void setSSLCertificateKeyFile(String SSLCertificateKeyFile) { 
this.SSLCertificateKeyFile = SSLCertificateKeyFile; }
  +
  +
  +/**
  + * SSL certificate chain file.
  + */
  +protected String SSLCertificateChainFile = null;
  +public String getSSLCertificateChainFile() { return 
SSLCertificateChainFile; }
  +public void setSSLCertificateChainFile(String SSLCertificateChainFile) { 
this.SSLCertificateChainFile = SSLCertificateChainFile; }
  +
  +
  +/**
  + * SSL CA certificate path.
  + */
  +protected String SSLCACertificatePath = null;
  +public String getSSLCACertificatePath() { return SSLCACertificatePath; }
  +public void setSSLCACertificatePath(String SSLCACertificatePath) { 
this.SSLCACertificatePath = SSLCACertificatePath; }
  +
  +
  +/**
  + * SSL CA certificate file.
  + */
  +protected String SSLCACertificateFile = null;
  +public String getSSLCACertificateFile() { return SSLCACertificateFile; }
  +public void setSSLCACertificateFile(String SSLCACertificateFile) { 
this.SSLCACertificateFile = SSLCACertificateFile; }
  +
  +
  +/**
  + * SSL CA revocation path.
  + */
  +protected String SSLCARevocationPath = null;
  +public String getSSLCARevocationPath() { return SSLCARevocationPath; }
  +public void setSSLCARevocationPath(String SSLCARevocationPath) { 
this.SSLCARevocationPath = SSLCARevocationPath; }
  +
  +
  +/**
  + * SSL CA revocation file.
  + */
  +protected String SSLCARevocationFile = null;
  +public String 

cvs commit: jakarta-tomcat-connectors/http11/src/java/org/apache/coyote/http11 Http11AprProtocol.java

2005-07-07 Thread remm
remm2005/07/07 07:08:40

  Modified:util/java/org/apache/tomcat/util/net AprEndpoint.java
   http11/src/java/org/apache/coyote/http11
Http11AprProtocol.java
  Log:
  - Client cert config should be an int.
  
  Revision  ChangesPath
  1.59  +4 -4  
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.58
  retrieving revision 1.59
  diff -u -r1.58 -r1.59
  --- AprEndpoint.java  7 Jul 2005 13:38:38 -   1.58
  +++ AprEndpoint.java  7 Jul 2005 14:08:40 -   1.59
  @@ -418,9 +418,9 @@
   /**
* SSL verify client.
*/
  -protected boolean SSLVerifyClient = false;
  -public boolean getSSLVerifyClient() { return SSLVerifyClient; }
  -public void setSSLVerifyClient(boolean SSLVerifyClient) { 
this.SSLVerifyClient = SSLVerifyClient; }
  +protected int SSLVerifyClient = 0;
  +public int getSSLVerifyClient() { return SSLVerifyClient; }
  +public void setSSLVerifyClient(int SSLVerifyClient) { 
this.SSLVerifyClient = SSLVerifyClient; }

   
   /**
  @@ -534,7 +534,7 @@
   // Load Server key and certificate
   SSLContext.setCertificate(sslContext, SSLCertificateFile, 
SSLCertificateKeyFile, SSLPassword, SSL.SSL_AIDX_RSA);
   // Support Client Certificates
  -SSLContext.setVerify(sslContext, SSLVerifyClient ? 1 : 0, 
SSLVerifyDepth);
  +SSLContext.setVerify(sslContext, SSLVerifyClient, 
SSLVerifyDepth);
   if (SSLCACertificateFile != null) {
   SSLContext.setCACertificate(sslContext, 
SSLCACertificateFile, null);
   }
  
  
  
  1.13  +2 -2  
jakarta-tomcat-connectors/http11/src/java/org/apache/coyote/http11/Http11AprProtocol.java
  
  Index: Http11AprProtocol.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/http11/src/java/org/apache/coyote/http11/Http11AprProtocol.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- Http11AprProtocol.java7 Jul 2005 13:38:38 -   1.12
  +++ Http11AprProtocol.java7 Jul 2005 14:08:40 -   1.13
  @@ -568,8 +568,8 @@
   /**
* SSL verify client.
*/
  -public boolean getSSLVerifyClient() { return ep.getSSLVerifyClient(); }
  -public void setSSLVerifyClient(boolean SSLVerifyClient) { 
ep.setSSLVerifyClient(SSLVerifyClient); }
  +public int getSSLVerifyClient() { return ep.getSSLVerifyClient(); }
  +public void setSSLVerifyClient(int SSLVerifyClient) { 
ep.setSSLVerifyClient(SSLVerifyClient); }
   
   
   /**
  
  
  

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



cvs commit: jakarta-tomcat-connectors/http11/src/java/org/apache/coyote/http11 Http11AprProtocol.java Http11AprProcessor.java

2005-07-07 Thread remm
remm2005/07/07 15:54:14

  Modified:http11/src/java/org/apache/coyote/http11
Http11AprProtocol.java Http11AprProcessor.java
  Log:
  - Fix if block for replay data.
  - The SSL code there is still a placeholder.
  
  Revision  ChangesPath
  1.14  +0 -1  
jakarta-tomcat-connectors/http11/src/java/org/apache/coyote/http11/Http11AprProtocol.java
  
  Index: Http11AprProtocol.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/http11/src/java/org/apache/coyote/http11/Http11AprProtocol.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- Http11AprProtocol.java7 Jul 2005 14:08:40 -   1.13
  +++ Http11AprProtocol.java7 Jul 2005 22:54:13 -   1.14
  @@ -187,7 +187,6 @@
   protected AprEndpoint ep=new AprEndpoint();
   protected boolean secure;
   
  -// socket factory attriubtes ( XXX replace with normal setters )
   protected Hashtable attributes = new Hashtable();
   
   private int maxKeepAliveRequests=100; // as in Apache HTTPD server
  
  
  
  1.22  +36 -34
jakarta-tomcat-connectors/http11/src/java/org/apache/coyote/http11/Http11AprProcessor.java
  
  Index: Http11AprProcessor.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/http11/src/java/org/apache/coyote/http11/Http11AprProcessor.java,v
  retrieving revision 1.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- Http11AprProcessor.java   3 Jul 2005 10:12:51 -   1.21
  +++ Http11AprProcessor.java   7 Jul 2005 22:54:13 -   1.22
  @@ -993,31 +993,6 @@
   
   started = false;
   
  -} else if (actionCode == ActionCode.ACTION_REQ_SSL_ATTRIBUTE ) {
  -
  -try {
  -if (sslSupport != null) {
  -Object sslO = sslSupport.getCipherSuite();
  -if (sslO != null)
  -request.setAttribute
  -(SSLSupport.CIPHER_SUITE_KEY, sslO);
  -sslO = sslSupport.getPeerCertificateChain(false);
  -if (sslO != null)
  -request.setAttribute
  -(SSLSupport.CERTIFICATE_KEY, sslO);
  -sslO = sslSupport.getKeySize();
  -if (sslO != null)
  -request.setAttribute
  -(SSLSupport.KEY_SIZE_KEY, sslO);
  -sslO = sslSupport.getSessionId();
  -if (sslO != null)
  -request.setAttribute
  -(SSLSupport.SESSION_ID_KEY, sslO);
  -}
  -} catch (Exception e) {
  -log.warn(Exception getting SSL attributes  ,e);
  -}
  -
   } else if (actionCode == ActionCode.ACTION_REQ_HOST_ADDR_ATTRIBUTE) {
   
   // Get remote host address
  @@ -1106,7 +1081,33 @@
   }
   request.setLocalPort(localPort);
   
  +} else if (actionCode == ActionCode.ACTION_REQ_SSL_ATTRIBUTE ) {
  +
  +try {
  +if (sslSupport != null) {
  +Object sslO = sslSupport.getCipherSuite();
  +if (sslO != null)
  +request.setAttribute
  +(SSLSupport.CIPHER_SUITE_KEY, sslO);
  +sslO = sslSupport.getPeerCertificateChain(false);
  +if (sslO != null)
  +request.setAttribute
  +(SSLSupport.CERTIFICATE_KEY, sslO);
  +sslO = sslSupport.getKeySize();
  +if (sslO != null)
  +request.setAttribute
  +(SSLSupport.KEY_SIZE_KEY, sslO);
  +sslO = sslSupport.getSessionId();
  +if (sslO != null)
  +request.setAttribute
  +(SSLSupport.SESSION_ID_KEY, sslO);
  +}
  +} catch (Exception e) {
  +log.warn(Exception getting SSL attributes  ,e);
  +}
  +
   } else if (actionCode == ActionCode.ACTION_REQ_SSL_CERTIFICATE) {
  +
   if( sslSupport != null) {
   /*
* Consume and buffer the request body, so that it does not
  @@ -1126,16 +1127,17 @@
   } catch (Exception e) {
   log.warn(Exception getting SSL Cert, e);
   }
  -} else if (actionCode == ActionCode.ACTION_REQ_SET_BODY_REPLAY) {
  -ByteChunk body = (ByteChunk) param;
  -
  -InputFilter savedBody = new SavedRequestInputFilter(body);
  -savedBody.setRequest(request);
  -
  -   

cvs commit: jakarta-tomcat-connectors/http11/src/java/org/apache/coyote/http11 Http11AprProtocol.java

2005-05-27 Thread remm
remm2005/05/27 08:40:23

  Modified:http11/src/java/org/apache/coyote/http11
Http11AprProtocol.java
  Log:
  - Call endpoint.destroy on destroy.
  
  Revision  ChangesPath
  1.8   +1 -1  
jakarta-tomcat-connectors/http11/src/java/org/apache/coyote/http11/Http11AprProtocol.java
  
  Index: Http11AprProtocol.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/http11/src/java/org/apache/coyote/http11/Http11AprProtocol.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- Http11AprProtocol.java26 May 2005 14:43:09 -  1.7
  +++ Http11AprProtocol.java27 May 2005 15:40:23 -  1.8
  @@ -198,7 +198,7 @@
   public void destroy() throws Exception {
   if(log.isInfoEnabled())
   log.info(sm.getString(http11protocol.stop, getName()));
  -ep.stop();
  +ep.destroy();
   if( tpOname!=null )
   Registry.getRegistry(null, null).unregisterComponent(tpOname);
   if( rgOname != null )
  
  
  

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



cvs commit: jakarta-tomcat-connectors/http11/src/java/org/apache/coyote/http11 Http11AprProtocol.java

2005-05-26 Thread remm
remm2005/05/26 07:43:10

  Modified:util/java/org/apache/tomcat/util/net AprEndpoint.java
   http11/src/java/org/apache/coyote/http11
Http11AprProtocol.java
  Log:
  - Allow configuring pollTime.
  - Use wait/notify for the poller.
  
  Revision  ChangesPath
  1.32  +8 -2  
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.31
  retrieving revision 1.32
  diff -u -r1.31 -r1.32
  --- AprEndpoint.java  26 May 2005 09:06:16 -  1.31
  +++ AprEndpoint.java  26 May 2005 14:43:09 -  1.32
  @@ -811,6 +811,7 @@
   addS[addCount] = socket;
   addP[addCount] = pool;
   addCount++;
  +addS.notify();
   }
   }
   
  @@ -834,7 +835,9 @@
   
   while (keepAliveCount  1  addCount  1) {
   try {
  -Thread.sleep(10);
  +synchronized (addS) {
  +addS.wait();
  +}
   } catch (InterruptedException e) {
   // Ignore
   }
  @@ -1153,6 +1156,7 @@
   // at most for pollTime before being polled
   synchronized (addS) {
   addS.add(sendfileData);
  +addS.notify();
   }
   return false;
   }
  @@ -1192,7 +1196,9 @@
   
   while (sendfileCount  1  addS.size()  1) {
   try {
  -Thread.sleep(10);
  +synchronized (addS) {
  +addS.wait();
  +}
   } catch (InterruptedException e) {
   // Ignore
   }
  
  
  
  1.7   +9 -0  
jakarta-tomcat-connectors/http11/src/java/org/apache/coyote/http11/Http11AprProtocol.java
  
  Index: Http11AprProtocol.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/http11/src/java/org/apache/coyote/http11/Http11AprProtocol.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- Http11AprProtocol.java25 May 2005 10:39:28 -  1.6
  +++ Http11AprProtocol.java26 May 2005 14:43:09 -  1.7
  @@ -287,6 +287,15 @@
   setAttribute(firstReadTimeout,  + i);
   }
   
  +public int getPollTime() {
  +return ep.getPollTime();
  +}
  +
  +public void setPollTime( int i ) {
  +ep.setPollTime(i);
  +setAttribute(pollTime,  + i);
  +}
  +
   public boolean getUseSendfile() {
   return ep.getUseSendfile();
   }
  
  
  

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: cvs commit: jakarta-tomcat-connectors/http11/src/java/org/apache/coyote/http11 Http11AprProtocol.java

2005-05-26 Thread Remy Maucherat

[EMAIL PROTECTED] wrote:

remm2005/05/26 07:43:10

  Modified:util/java/org/apache/tomcat/util/net AprEndpoint.java
   http11/src/java/org/apache/coyote/http11
Http11AprProtocol.java
  Log:
  - Allow configuring pollTime.
  - Use wait/notify for the poller.


/usr/sbin/ab.exe -n 2 -c 20 -k http://127.0.0.1:8080/tomcat.gif with 
the different configuration options that I added.
I used JDK 1.4.2 client, since it's easier. JDK 5 server gives closer 
results for the last two (slightly faster JNI, I guess).


Right now, with localhost testing (no gigabit here, so no other solution):
a) APR with firstReadTimeout=0 pollTime=2000 (= all keepalive 
requests go to the poller without any blocking read; note: the default 
5000 pollTime is a few %s slower - more latency - but will probably 
save a little CPU): 6100 req/s

b) default APR settings: 7700 req/s
c) regular connector: 8000 req/s

Rémy

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



cvs commit: jakarta-tomcat-connectors/http11/src/java/org/apache/coyote/http11 Http11AprProtocol.java

2005-05-25 Thread remm
remm2005/05/25 03:39:28

  Modified:http11/src/java/org/apache/coyote/http11
Http11AprProtocol.java
  Log:
  - Add config of firstReadTimeout.
  
  Revision  ChangesPath
  1.6   +9 -0  
jakarta-tomcat-connectors/http11/src/java/org/apache/coyote/http11/Http11AprProtocol.java
  
  Index: Http11AprProtocol.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/http11/src/java/org/apache/coyote/http11/Http11AprProtocol.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- Http11AprProtocol.java22 May 2005 17:12:11 -  1.5
  +++ Http11AprProtocol.java25 May 2005 10:39:28 -  1.6
  @@ -278,6 +278,15 @@
   setAttribute(port,  + port);
   }
   
  +public int getFirstReadTimeout() {
  +return ep.getFirstReadTimeout();
  +}
  +
  +public void setFirstReadTimeout( int i ) {
  +ep.setFirstReadTimeout(i);
  +setAttribute(firstReadTimeout,  + i);
  +}
  +
   public boolean getUseSendfile() {
   return ep.getUseSendfile();
   }
  
  
  

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



cvs commit: jakarta-tomcat-connectors/http11/src/java/org/apache/coyote/http11 Http11AprProtocol.java

2005-04-20 Thread remm
remm2005/04/20 09:40:52

  Modified:http11/src/java/org/apache/coyote/http11
Http11AprProtocol.java
  Log:
  - Add needed get/set for sendfile.
  
  Revision  ChangesPath
  1.4   +8 -0  
jakarta-tomcat-connectors/http11/src/java/org/apache/coyote/http11/Http11AprProtocol.java
  
  Index: Http11AprProtocol.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/http11/src/java/org/apache/coyote/http11/Http11AprProtocol.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- Http11AprProtocol.java18 Apr 2005 16:47:47 -  1.3
  +++ Http11AprProtocol.java20 Apr 2005 16:40:52 -  1.4
  @@ -280,6 +280,14 @@
   setAttribute(port,  + port);
   }
   
  +public boolean getUseSendfile() {
  +return ep.getUseSendfile();
  +}
  +
  +public void setUseSendfile(boolean useSendfile) {
  +ep.setUseSendfile(useSendfile);
  +}
  +
   public InetAddress getAddress() {
   return ep.getAddress();
   }
  
  
  

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



cvs commit: jakarta-tomcat-connectors/http11/src/java/org/apache/coyote/http11 Http11AprProtocol.java Http11AprProcessor.java

2005-04-18 Thread remm
remm2005/04/18 09:47:48

  Modified:util/java/org/apache/tomcat/util/net AprEndpoint.java
   http11/src/java/org/apache/coyote/http11
Http11AprProtocol.java Http11AprProcessor.java
  Log:
  - Add the basis for sendfile (not used yet).
  - Bugfixes to poll handling.
  - The processor will now send the socket to the poller by itself (allows 
future similar use of sendfile), while the boolean will only
indicate if the socket should be closed or not.
is only used to indicate if the socket is to be closed.
  
  Revision  ChangesPath
  1.9   +254 -34   
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.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- AprEndpoint.java  18 Apr 2005 13:57:12 -  1.8
  +++ AprEndpoint.java  18 Apr 2005 16:47:47 -  1.9
  @@ -17,6 +17,7 @@
   package org.apache.tomcat.util.net;
   
   import java.net.InetAddress;
  +import java.util.HashMap;
   import java.util.Stack;
   import java.util.Vector;
   
  @@ -24,6 +25,7 @@
   import org.apache.commons.logging.LogFactory;
   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;
  @@ -73,12 +75,6 @@
   
   
   /**
  - * The socket poller.
  - */
  -protected Poller poller = null;
  -
  -
  -/**
* The socket poller thread.
*/
   protected Thread pollerThread = null;
  @@ -87,7 +83,6 @@
   /**
* The sendfile thread.
*/
  -// FIXME: Add senfile support
   protected Thread sendfileThread = null;
   
   
  @@ -180,12 +175,20 @@
   /**
* Size of the socket poller.
*/
  -protected int pollerSize = 512;
  +protected int pollerSize = 768;
   public void setPollerSize(int pollerSize) { this.pollerSize = 
pollerSize; }
   public int getPollerSize() { return pollerSize; }
   
   
   /**
  + * Size of the sendfile (= concurrent files which can be served).
  + */
  +protected int sendfileSize = 256;
  +public void setSendfileSize(int sendfileSize) { this.sendfileSize = 
sendfileSize; }
  +public int getSendfileSize() { return sendfileSize; }
  +
  +
  +/**
* Server socket port.
*/
   protected int port;
  @@ -283,10 +286,30 @@
*/
   protected int keepAliveCount = 0;
   public int getKeepAliveCount() { return keepAliveCount; }
  -public void setKeepAliveCount(int keepAliveCount) { this.keepAliveCount 
= keepAliveCount; }
  +
  +
  +/**
  + * Number of sendfile sockets.
  + */
  +protected int sendfileCount = 0;
  +public int getSendfileCount() { return sendfileCount; }
  +
  +
  +/**
  + * The socket poller.
  + */
  +protected Poller poller = null;
  +public Poller getPoller() { return poller; }
   
   
   /**
  + * The static file sender.
  + */
  +protected Sendfile sendfile = null;
  +public Sendfile getSendfile() { return sendfile; }
  +
  +
  +/**
* Dummy maxSpareThreads property.
*/
   public int getMaxSpareThreads() { return 0; }
  @@ -412,14 +435,20 @@
   acceptorThread.start();
   
   // Start poller thread
  -poller = new Poller(pollerSize);
  +poller = new Poller();
  +poller.init();
   pollerThread = new Thread(poller, getName() + -Poller);
   pollerThread.setPriority(getThreadPriority());
   pollerThread.setDaemon(true);
   pollerThread.start();
   
   // Start sendfile thread
  -// FIXME: Implement sendfile support
  +sendfile = new Sendfile();
  +sendfile.init();
  +sendfileThread = new Thread(sendfile, getName() + -Sendfile);
  +sendfileThread.setPriority(getThreadPriority());
  +sendfileThread.setDaemon(true);
  +sendfileThread.start();
   }
   }
   
  @@ -441,6 +470,8 @@
   if (running) {
   running = false;
   unlockAccept();
  +poller.destroy();
  +sendfile.destroy();
   acceptorThread = null;
   pollerThread = null;
   sendfileThread = null;
  @@ -519,14 +550,14 @@
   }
   
   
  -protected boolean processSocket(long s) {
  +protected boolean processSocket(long socket, long pool) {
   // Process the connection
   int step = 1;
   boolean result = true;
   try {
   
   // 1: Set socket