(SocketWrapperBase<?> socket)
| 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 | /* |
nothing calls this directly
no test coverage detected