comparison src/org/eclipse/jetty/server/Server.java @ 929:3191abe890ef

remove isInitial()
author Franklin Schmidt <fschmidt@gmail.com>
date Sun, 09 Oct 2016 19:13:46 -0600
parents 17f4fe8271de
children 53b3f7d9714c
comparison
equal deleted inserted replaced
928:23a57aad34c0 929:3191abe890ef
155 } 155 }
156 else 156 else
157 handle(target, request, request, response); 157 handle(target, request, request, response);
158 } 158 }
159 159
160 /* ------------------------------------------------------------ */
161 /* Handle a request from a connection.
162 * Called to handle a request on the connection when either the header has been received,
163 * or after the entire request has been received (for short requests of known length), or
164 * on the dispatch of an async request.
165 */
166 public void handleAsync(AbstractHttpConnection connection) throws IOException, ServletException
167 {
168 final AsyncContinuation async = connection.getRequest().getAsyncContinuation();
169 final AsyncContinuation.AsyncEventState state = async.getAsyncEventState();
170
171 final Request baseRequest=connection.getRequest();
172 final String path=state.getPath();
173
174 if (path!=null)
175 {
176 // this is a dispatch with a path
177 final String contextPath=state.getServletContext().getContextPath();
178 HttpURI uri = new HttpURI(URIUtil.addPaths(contextPath,path));
179 baseRequest.setUri(uri);
180 baseRequest.setRequestURI(null);
181 baseRequest.setPathInfo(baseRequest.getRequestURI());
182 if (uri.getQuery()!=null)
183 baseRequest.mergeQueryString(uri.getQuery()); //we have to assume dispatch path and query are UTF8
184 }
185
186 final String target=baseRequest.getPathInfo();
187 final HttpServletRequest request=(HttpServletRequest)async.getRequest();
188 final HttpServletResponse response=(HttpServletResponse)async.getResponse();
189
190 if (LOG.isDebugEnabled())
191 {
192 LOG.debug("REQUEST "+target+" on "+connection);
193 handle(target, baseRequest, request, response);
194 LOG.debug("RESPONSE "+target+" "+connection.getResponse().getStatus());
195 }
196 else
197 handle(target, baseRequest, request, response);
198
199 }
200
201
202 public void join() throws InterruptedException 160 public void join() throws InterruptedException
203 { 161 {
204 threadPool.awaitTermination(Long.MAX_VALUE, TimeUnit.MILLISECONDS); 162 threadPool.awaitTermination(Long.MAX_VALUE, TimeUnit.MILLISECONDS);
205 } 163 }
206 164