Return-Path: X-Original-To: apmail-tomcat-dev-archive@www.apache.org Delivered-To: apmail-tomcat-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 1F5D5103BA for ; Tue, 4 Jun 2013 13:02:20 +0000 (UTC) Received: (qmail 5012 invoked by uid 500); 4 Jun 2013 13:02:19 -0000 Delivered-To: apmail-tomcat-dev-archive@tomcat.apache.org Received: (qmail 4900 invoked by uid 500); 4 Jun 2013 13:02:18 -0000 Mailing-List: contact dev-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Developers List" Delivered-To: mailing list dev@tomcat.apache.org Received: (qmail 4891 invoked by uid 99); 4 Jun 2013 13:02:18 -0000 Received: from minotaur.apache.org (HELO minotaur.apache.org) (140.211.11.9) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 04 Jun 2013 13:02:18 +0000 Received: from localhost (HELO [192.168.23.9]) (127.0.0.1) (smtp-auth username markt, mechanism plain) by minotaur.apache.org (qpsmtpd/0.29) with ESMTP; Tue, 04 Jun 2013 13:02:18 +0000 Message-ID: <51ADE554.4060401@apache.org> Date: Tue, 04 Jun 2013 14:02:12 +0100 From: Mark Thomas User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130509 Thunderbird/17.0.6 MIME-Version: 1.0 To: Tomcat Developers List Subject: Re: AsyncContext.dispatch(path) invoked more than once References: In-Reply-To: X-Enigmail-Version: 1.5.1 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit On 04/06/2013 13:55, Violeta Georgieva wrote: > 2013/5/31 Violeta Georgieva wrote: >> Let's put this as plan B for now. >> >> I made a small change in the AsyncContextImpl.doInternalDispatch(). >> >> Can you comment on the patch? >> >> >> Index: C:/tc8.0.x/java/org/apache/catalina/core/AsyncContextImpl.java >> =================================================================== >> --- C:/tc8.0.x/java/org/apache/catalina/core/AsyncContextImpl.java > (revision 1488110) >> +++ C:/tc8.0.x/java/org/apache/catalina/core/AsyncContextImpl.java > (working copy) >> @@ -185,6 +185,10 @@ >> logDebug("dispatch "); >> } >> check(); >> + if (dispatch != null) { >> + throw new IllegalStateException( >> + sm.getString("asyncContextImpl.dispatchingStarted")); >> + } >> if (request.getAttribute(ASYNC_REQUEST_URI)==null) { >> request.setAttribute(ASYNC_REQUEST_URI, > request.getRequestURI()); >> request.setAttribute(ASYNC_CONTEXT_PATH, > request.getContextPath()); >> @@ -347,7 +351,9 @@ >> logDebug("intDispatch"); >> } >> try { >> - dispatch.run(); >> + Runnable runnable = dispatch; >> + dispatch = null; >> + runnable.run(); >> if (!request.isAsync()) { >> fireOnComplete(); >> } >> >> > > Can you comment? Looks good to me. > Any other suggestions? Nope :) Mark --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org For additional commands, e-mail: dev-help@tomcat.apache.org