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

(-)java/org/apache/catalina/connector/CoyoteAdapter.java (-2 lines)
Lines 318-325 Link Here
318
318
319
        } catch (IOException e) {
319
        } catch (IOException e) {
320
            ;
320
            ;
321
        } catch (Throwable t) {
322
            log.error(sm.getString("coyoteAdapter.service"), t);
323
        } finally {
321
        } finally {
324
            req.getRequestProcessor().setWorkerThreadName(null);
322
            req.getRequestProcessor().setWorkerThreadName(null);
325
            // Recycle the wrapper request and response
323
            // Recycle the wrapper request and response
(-)java/org/apache/catalina/connector/LocalStrings.properties (-1 lines)
Lines 34-40 Link Here
34
#
34
#
35
# CoyoteAdapter
35
# CoyoteAdapter
36
#
36
#
37
coyoteAdapter.service=An exception or error occurred in the container during the request processing
38
coyoteAdapter.read=The servlet did not read all available bytes during the processing of the read event
37
coyoteAdapter.read=The servlet did not read all available bytes during the processing of the read event
39
coyoteAdapter.parseSession=Unable to parse the session ID using encoding [{0}]. The session ID in the URL will be ignored.
38
coyoteAdapter.parseSession=Unable to parse the session ID using encoding [{0}]. The session ID in the URL will be ignored.
40
coyoteAdapter.parsePathParam=Unable to parse the path parameters using encoding [{0}]. The path parameters in the URL will be ignored.
39
coyoteAdapter.parsePathParam=Unable to parse the path parameters using encoding [{0}]. The path parameters in the URL will be ignored.
(-)java/org/apache/catalina/connector/LocalStrings_es.properties (-1 lines)
Lines 29-35 Link Here
29
coyoteConnector.protocolUnregistrationFailed = Ha fallado la parada del manejador de protocolo
29
coyoteConnector.protocolUnregistrationFailed = Ha fallado la parada del manejador de protocolo
30
#
30
#
31
# CoyoteAdapter
31
# CoyoteAdapter
32
coyoteAdapter.service = Ha tenido lugar una excepci\u00F3n o error en el contenedor durante el procesamiento del requerimiento
33
coyoteAdapter.read = El servlet no ley\u00F3 todos los bytes disponibles durante el procesamiento del evento de lectura
32
coyoteAdapter.read = El servlet no ley\u00F3 todos los bytes disponibles durante el procesamiento del evento de lectura
34
#
33
#
35
# CoyoteResponse
34
# CoyoteResponse
(-)java/org/apache/catalina/connector/LocalStrings_fr.properties (-6 lines)
Lines 31-42 Link Here
31
coyoteConnector.protocolHandlerResumeFailed=Le red\u00e9marrage du gestionnaire de protocole a \u00e9chou\u00e9
31
coyoteConnector.protocolHandlerResumeFailed=Le red\u00e9marrage du gestionnaire de protocole a \u00e9chou\u00e9
32
32
33
#
33
#
34
# CoyoteAdapter
35
#
36
37
coyoteAdapter.service=Une exception ou une erreur s''est produite dans le conteneur durant le traitement de la requ\u00eate
38
39
#
40
# CoyoteResponse
34
# CoyoteResponse
41
#
35
#
42
36
(-)java/org/apache/catalina/connector/LocalStrings_ja.properties (-6 lines)
Lines 31-42 Link Here
31
coyoteConnector.protocolHandlerResumeFailed=\u30d7\u30ed\u30c8\u30b3\u30eb\u30cf\u30f3\u30c9\u30e9\u306e\u518d\u958b\u306b\u5931\u6557\u3057\u307e\u3057\u305f
31
coyoteConnector.protocolHandlerResumeFailed=\u30d7\u30ed\u30c8\u30b3\u30eb\u30cf\u30f3\u30c9\u30e9\u306e\u518d\u958b\u306b\u5931\u6557\u3057\u307e\u3057\u305f
32
32
33
#
33
#
34
# CoyoteAdapter
35
#
36
37
coyoteAdapter.service=\u30ea\u30af\u30a8\u30b9\u30c8\u306e\u51e6\u7406\u4e2d\u306b\u30b3\u30cd\u30af\u30bf\u3067\u4f8b\u5916\u307e\u305f\u306f\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u307e\u3057\u305f
38
39
#
40
# CoyoteResponse
34
# CoyoteResponse
41
#
35
#
42
36
(-)java/org/apache/coyote/http11/Http11NioProtocol.java (-7 / +1 lines)
Lines 746-758 Link Here
746
                    // In the middle of processing a request/response. Keep the
746
                    // In the middle of processing a request/response. Keep the
747
                    // socket associated with the processor.
747
                    // socket associated with the processor.
748
                    connections.put(socket, processor);
748
                    connections.put(socket, processor);
749
749
                    socket.getPoller().add(socket);
750
                    if (processor.comet) {
751
                        NioEndpoint.KeyAttachment att = (NioEndpoint.KeyAttachment)socket.getAttachment(false);
752
                        socket.getPoller().add(socket,att.getCometOps());
753
                    } else {
754
                        socket.getPoller().add(socket);
755
                    }
756
                } else if (state == SocketState.OPEN) {
750
                } else if (state == SocketState.OPEN) {
757
                    // In keep-alive but between requests. OK to recycle
751
                    // In keep-alive but between requests. OK to recycle
758
                    // processor. Continue to poll for the next request.
752
                    // processor. Continue to poll for the next request.
(-)java/org/apache/jk/server/JkCoyoteHandler.java (+1 lines)
Lines 189-194 Link Here
189
        try {
189
        try {
190
            adapter.service( req, res );
190
            adapter.service( req, res );
191
        } catch( Exception ex ) {
191
        } catch( Exception ex ) {
192
            ep.setStatus(MsgContext.JK_STATUS_ERROR);
192
            log.info("Error servicing request " + req,ex);
193
            log.info("Error servicing request " + req,ex);
193
        }
194
        }
194
        if(ep.getStatus() != MsgContext.JK_STATUS_CLOSED) {
195
        if(ep.getStatus() != MsgContext.JK_STATUS_CLOSED) {
(-)java/org/apache/tomcat/util/net/NioEndpoint.java (-70 / +72 lines)
Lines 2251-2333 Link Here
2251
        }
2251
        }
2252
         
2252
         
2253
        public void run() {
2253
        public void run() {
2254
            NioEndpoint.this.activeSocketProcessors.addAndGet(1);
2254
            synchronized (socket) {
2255
            SelectionKey key = null;
2255
                NioEndpoint.this.activeSocketProcessors.addAndGet(1);
2256
            try {
2256
                SelectionKey key = null;
2257
                key = socket.getIOChannel().keyFor(socket.getPoller().getSelector());
2258
                int handshake = -1;
2259
                
2260
                try {
2257
                try {
2261
                    if (key!=null) handshake = socket.handshake(key.isReadable(), key.isWritable());
2258
                    key = socket.getIOChannel().keyFor(socket.getPoller().getSelector());
2262
                }catch ( IOException x ) {
2259
                    int handshake = -1;
2263
                    handshake = -1;
2260
                    
2264
                    if ( log.isDebugEnabled() ) log.debug("Error during SSL handshake",x);
2261
                    try {
2265
                }catch ( CancelledKeyException ckx ) {
2262
                        if (key!=null) handshake = socket.handshake(key.isReadable(), key.isWritable());
2266
                    handshake = -1;
2263
                    }catch ( IOException x ) {
2267
                }
2264
                        handshake = -1;
2268
                if ( handshake == 0 ) {
2265
                        if ( log.isDebugEnabled() ) log.debug("Error during SSL handshake",x);
2269
                    // Process the request from this socket
2266
                    }catch ( CancelledKeyException ckx ) {
2270
                    boolean closed = (status==null)?(handler.process(socket)==Handler.SocketState.CLOSED) :
2267
                        handshake = -1;
2271
                        (handler.event(socket,status)==Handler.SocketState.CLOSED);
2268
                    }
2272
2269
                    if ( handshake == 0 ) {
2273
                    if (closed) {
2270
                        // Process the request from this socket
2274
                        // Close socket and pool
2271
                        boolean closed = (status==null)?(handler.process(socket)==Handler.SocketState.CLOSED) :
2275
                        try {
2272
                            (handler.event(socket,status)==Handler.SocketState.CLOSED);
2276
                            KeyAttachment ka = null;
2273
    
2277
                            if (key!=null) {
2274
                        if (closed) {
2278
                                ka = (KeyAttachment) key.attachment();
2275
                            // Close socket and pool
2279
                                if (ka!=null) ka.setComet(false);
2276
                            try {
2280
                                socket.getPoller().cancelledKey(key, SocketStatus.ERROR, false);
2277
                                KeyAttachment ka = null;
2278
                                if (key!=null) {
2279
                                    ka = (KeyAttachment) key.attachment();
2280
                                    if (ka!=null) ka.setComet(false);
2281
                                    socket.getPoller().cancelledKey(key, SocketStatus.ERROR, false);
2282
                                }
2283
                                if (socket!=null) nioChannels.offer(socket);
2284
                                socket = null;
2285
                                if ( ka!=null ) keyCache.offer(ka);
2286
                                ka = null;
2287
                            }catch ( Exception x ) {
2288
                                log.error("",x);
2281
                            }
2289
                            }
2282
                            if (socket!=null) nioChannels.offer(socket);
2290
                        } 
2283
                            socket = null;
2291
                    } else if (handshake == -1 ) {
2284
                            if ( ka!=null ) keyCache.offer(ka);
2292
                        KeyAttachment ka = null;
2285
                            ka = null;
2293
                        if (key!=null) {
2286
                        }catch ( Exception x ) {
2294
                            ka = (KeyAttachment) key.attachment();
2287
                            log.error("",x);
2295
                            socket.getPoller().cancelledKey(key, SocketStatus.DISCONNECT, false);
2288
                        }
2296
                        }
2289
                    } 
2297
                        if (socket!=null) nioChannels.offer(socket);
2290
                } else if (handshake == -1 ) {
2298
                        socket = null;
2291
                    KeyAttachment ka = null;
2299
                        if ( ka!=null ) keyCache.offer(ka);
2292
                    if (key!=null) {
2300
                        ka = null;
2293
                        ka = (KeyAttachment) key.attachment();
2301
                    } else {
2294
                        socket.getPoller().cancelledKey(key, SocketStatus.DISCONNECT, false);
2302
                        final SelectionKey fk = key;
2303
                        final int intops = handshake;
2304
                        final KeyAttachment ka = (KeyAttachment)fk.attachment();
2305
                        ka.getPoller().add(socket,intops);
2295
                    }
2306
                    }
2296
                    if (socket!=null) nioChannels.offer(socket);
2307
                }catch(CancelledKeyException cx) {
2308
                    socket.getPoller().cancelledKey(key,null,false);
2309
                } catch (OutOfMemoryError oom) {
2310
                    try {
2311
                        oomParachuteData = null;
2312
                        socket.getPoller().cancelledKey(key,SocketStatus.ERROR,false);
2313
                        releaseCaches();
2314
                        log.error("", oom);
2315
                    }catch ( Throwable oomt ) {
2316
                        try {
2317
                            System.err.println(oomParachuteMsg);
2318
                            oomt.printStackTrace();
2319
                        }catch (Throwable letsHopeWeDontGetHere){}
2320
                    }
2321
                }catch ( Throwable t ) {
2322
                    log.error("",t);
2323
                    socket.getPoller().cancelledKey(key,SocketStatus.ERROR,false);
2324
                } finally {
2297
                    socket = null;
2325
                    socket = null;
2298
                    if ( ka!=null ) keyCache.offer(ka);
2326
                    status = null;
2299
                    ka = null;
2327
                    //return to cache
2300
                } else {
2328
                    processorCache.offer(this);
2301
                    final SelectionKey fk = key;
2329
                    NioEndpoint.this.activeSocketProcessors.addAndGet(-1);
2302
                    final int intops = handshake;
2303
                    final KeyAttachment ka = (KeyAttachment)fk.attachment();
2304
                    ka.getPoller().add(socket,intops);
2305
                }
2330
                }
2306
            }catch(CancelledKeyException cx) {
2331
            }
2307
                socket.getPoller().cancelledKey(key,null,false);
2308
            } catch (OutOfMemoryError oom) {
2309
                try {
2310
                    oomParachuteData = null;
2311
                    socket.getPoller().cancelledKey(key,SocketStatus.ERROR,false);
2312
                    releaseCaches();
2313
                    log.error("", oom);
2314
                }catch ( Throwable oomt ) {
2315
                    try {
2316
                        System.err.println(oomParachuteMsg);
2317
                        oomt.printStackTrace();
2318
                    }catch (Throwable letsHopeWeDontGetHere){}
2319
                }
2320
            }catch ( Throwable t ) {
2321
                log.error("",t);
2322
                socket.getPoller().cancelledKey(key,SocketStatus.ERROR,false);
2323
            } finally {
2324
                socket = null;
2325
                status = null;
2326
                //return to cache
2327
                processorCache.offer(this);
2328
                NioEndpoint.this.activeSocketProcessors.addAndGet(-1);            }
2329
        }
2332
        }
2330
2331
    }
2333
    }
2332
    
2334
    
2333
    // ---------------------------------------------- TaskQueue Inner Class
2335
    // ---------------------------------------------- TaskQueue Inner Class

Return to bug 51550