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

(-)java/org/apache/catalina/connector/CoyoteAdapter.java (-14 / +19 lines)
Lines 664-689 Link Here
664
            org.apache.coyote.Response res) {
664
            org.apache.coyote.Response res) {
665
        Request request = (Request) req.getNote(ADAPTER_NOTES);
665
        Request request = (Request) req.getNote(ADAPTER_NOTES);
666
        Response response = (Response) res.getNote(ADAPTER_NOTES);
666
        Response response = (Response) res.getNote(ADAPTER_NOTES);
667
        try {
667
        String messageKey = null;
668
            if (request != null && request.getHost() != null) {
668
        if (request != null && request.getHost() != null) {
669
                throw new RecycleRequiredException();
669
            messageKey = "coyoteAdapter.checkRecycled.request";
670
            }
670
        } else if (response != null && response.getContentWritten() != 0) {
671
            if (response != null && response.getContentWritten() != 0) {
671
            messageKey = "coyoteAdapter.checkRecycled.response";
672
                throw new RecycleRequiredException();
672
        }
673
            }
673
        if (messageKey != null) {
674
        } catch (RecycleRequiredException e) {
674
            // Log this request, as it has probably skipped the access log.
675
            String message = sm.getString("coyoteAdapter.checkRecycled");
675
            // The log() method will take care of recycling.
676
            log(req, res, 0L);
677
676
            if (connector.getState().isAvailable()) {
678
            if (connector.getState().isAvailable()) {
677
                log.info(message, e);
679
                if (log.isInfoEnabled()) {
680
                    log.info(sm.getString(messageKey),
681
                            new RecycleRequiredException());
682
                }
678
            } else {
683
            } else {
679
                // There may be some aborted requests.
684
                // There may be some aborted requests.
680
                // When connector shuts down, the request and response will not
685
                // When connector shuts down, the request and response will not
681
                // be reused, so there is no issue to warn about here.
686
                // be reused, so there is no issue to warn about here.
682
                log.debug(message, e);
687
                if (log.isDebugEnabled()) {
688
                    log.debug(sm.getString(messageKey),
689
                            new RecycleRequiredException());
690
                }
683
            }
691
            }
684
            // Log this request, as it has probably skipped the access log.
685
            // The log() method will take care of recycling.
686
            log(req, res, 0L);
687
        }
692
        }
688
    }
693
    }
689
694
(-)java/org/apache/catalina/connector/LocalStrings.properties (-1 / +2 lines)
Lines 17-23 Link Here
17
17
18
coyoteAdapter.accesslogFail=Exception while attempting to add an entry to the access log
18
coyoteAdapter.accesslogFail=Exception while attempting to add an entry to the access log
19
coyoteAdapter.asyncDispatch=Exception while processing an asynchronous request
19
coyoteAdapter.asyncDispatch=Exception while processing an asynchronous request
20
coyoteAdapter.checkRecycled=A non-recycled request encountered. It will be recycled forcedly.
20
coyoteAdapter.checkRecycled.request=CoyoteAdapter encountered a non-recycled request and recycled it forcedly.
21
coyoteAdapter.checkRecycled.response=CoyoteAdapter encountered a non-recycled response and recycled it forcedly.
21
coyoteAdapter.debug=The variable [{0}] has value [{1}]
22
coyoteAdapter.debug=The variable [{0}] has value [{1}]
22
coyoteAdapter.parsePathParam=Unable to parse the path parameters using encoding [{0}]. The path parameters in the URL will be ignored.
23
coyoteAdapter.parsePathParam=Unable to parse the path parameters using encoding [{0}]. The path parameters in the URL will be ignored.
23
24

Return to bug 56399