View | Details | Raw Unified | Return to bug 59797
Collapse All | Expand All

(-)file_not_specified_in_diff (-6 / +27 lines)
Line  Link Here
0
-- a/java/org/apache/tomcat/jni/SSL.java
0
++ b/java/org/apache/tomcat/jni/SSL.java
Lines 388-391 public final class SSL { Link Here
388
     * @return true if all SSL_OP_* are supported by OpenSSL library.
388
     * @return true if all SSL_OP_* are supported by OpenSSL library.
389
     */
389
     */
390
    public static native boolean hasOp(int op);
390
    public static native boolean hasOp(int op);
391
392
    /**
393
     * Cleanup thread specific data structures. This needs to be called after a thread
394
     * has completed ssl operations.
395
     */
396
    public static native void threadCleanup();
391
}
397
}
392
-- a/java/org/apache/tomcat/util/net/AprEndpoint.java
398
++ b/java/org/apache/tomcat/util/net/AprEndpoint.java
Lines 2411-2416 public class AprEndpoint extends AbstractEndpoint<Long> { Link Here
2411
    }
2411
    }
2412
    private abstract class BaseSocketProcessor implements Runnable {
2413
        @Override
2414
        public void run() {
2415
            try {
2416
                realRun();
2417
            } finally {
2418
                if (isSSLEnabled()) {
2419
                    SSL.threadCleanup();
2420
                }
2421
            }
2422
        }
2423
2424
        protected abstract void realRun();
2425
    }
2426
2412
    // --------------------------------- SocketWithOptionsProcessor Inner Class
2427
    // --------------------------------- SocketWithOptionsProcessor Inner Class
2413
    /**
2428
    /**
Lines 2420-2426 public class AprEndpoint extends AbstractEndpoint<Long> { Link Here
2420
     *
2435
     *
2421
     * This is called after an accept().
2436
     * This is called after an accept().
2422
     */
2437
     */
2423
    protected class SocketWithOptionsProcessor implements Runnable {
2438
    protected class SocketWithOptionsProcessor extends BaseSocketProcessor {
2424
        protected SocketWrapper<Long> socket = null;
2439
        protected SocketWrapper<Long> socket = null;
Lines 2430-2436 public class AprEndpoint extends AbstractEndpoint<Long> { Link Here
2430
        }
2445
        }
2431
        @Override
2446
        @Override
2432
        public void run() {
2447
        public void realRun() {
2433
            synchronized (socket) {
2448
            synchronized (socket) {
2434
                if (!deferAccept) {
2449
                if (!deferAccept) {
Lines 2476-2482 public class AprEndpoint extends AbstractEndpoint<Long> { Link Here
2476
     * This class is the equivalent of the Worker, but will simply use in an
2491
     * This class is the equivalent of the Worker, but will simply use in an
2477
     * external Executor thread pool.
2492
     * external Executor thread pool.
2478
     */
2493
     */
2479
    protected class SocketProcessor implements Runnable {
2494
    protected class SocketProcessor extends BaseSocketProcessor {
2480
        private final SocketWrapper<Long> socket;
2495
        private final SocketWrapper<Long> socket;
2481
        private final SocketStatus status;
2496
        private final SocketStatus status;
Lines 2492-2498 public class AprEndpoint extends AbstractEndpoint<Long> { Link Here
2492
        }
2507
        }
2493
        @Override
2508
        @Override
2494
        public void run() {
2509
        public void realRun() {
2495
            // Upgraded connections need to allow multiple threads to access the
2510
            // Upgraded connections need to allow multiple threads to access the
2496
            // connection at the same time to enable blocking IO tobe used when
2511
            // connection at the same time to enable blocking IO tobe used when

Return to bug 59797