MCPcopy Create free account
hub / github.com/apache/tomcat / service

Method service

java/org/apache/coyote/http2/StreamProcessor.java:455–486  ·  view source on GitHub ↗
(SocketWrapperBase<?> socket)

Source from the content-addressed store, hash-verified

453
454
455 @Override
456 public final SocketState service(SocketWrapperBase<?> socket) throws IOException {
457 try {
458 if (validateRequest()) {
459 adapter.service(request, response);
460 } else {
461 response.setStatus(HttpServletResponse.SC_BAD_REQUEST);
462 adapter.log(request, response, 0);
463 setErrorState(ErrorState.CLOSE_CLEAN, null);
464 }
465 } catch (Exception e) {
466 if (log.isDebugEnabled()) {
467 log.debug(sm.getString("streamProcessor.service.error"), e);
468 }
469 response.setStatus(500);
470 setErrorState(ErrorState.CLOSE_NOW, e);
471 }
472
473 if (sendfileState == SendfileState.PENDING) {
474 return SocketState.SENDFILE;
475 } else if (getErrorState().isError()) {
476 action(ActionCode.CLOSE, null);
477 request.updateCounters();
478 return SocketState.CLOSED;
479 } else if (isAsync()) {
480 return SocketState.LONG;
481 } else {
482 action(ActionCode.CLOSE, null);
483 request.updateCounters();
484 return SocketState.CLOSED;
485 }
486 }
487
488
489 /*

Callers

nothing calls this directly

Calls 13

validateRequestMethod · 0.95
getErrorStateMethod · 0.80
serviceMethod · 0.65
setStatusMethod · 0.65
logMethod · 0.65
isDebugEnabledMethod · 0.65
debugMethod · 0.65
getStringMethod · 0.65
actionMethod · 0.65
isAsyncMethod · 0.65
setErrorStateMethod · 0.45
isErrorMethod · 0.45

Tested by

no test coverage detected