public void write(final HttpResponse message) throws IOException, HttpException { if (message != null && headerlog.isDebugEnabled()) { String skipLogging = System.getProperty("skip.logging"); Object request = session.getAttribute("http.request"); if ("true".equals(skipLogging) && request != null) { String uri = ((HttpRequest) request).getRequestLine().toString(); Pattern pattern = LoggingUtils.getSkipLoggingMatcher(); if (pattern != null && !pattern.matcher(uri).find()) { printLog(message); } } else { printLog(message); } } if (message != null && accesslog.isInfoEnabled()) { HttpResponse response = (HttpResponse) message; HttpParams params = response.getParams(); final SocketAddress remoteAddress = session.getRemoteAddress(); if (remoteAddress instanceof InetSocketAddress) { final InetSocketAddress remote = (( InetSocketAddress) remoteAddress); params.setParameter("http.remote.addr", remote.getAddress().getHostAddress()); } AccessHandler.getAccess().addAccessToQueue(message); } this.writer.write(message); }
public void write(final HttpRequest message) throws IOException, HttpException { if (message != null && headerlog.isDebugEnabled()) { String skipLogging = System.getProperty("skip.logging"); Object request = session.getAttribute("http.request"); if ("true".equals(skipLogging) && request != null) { String uri = ((HttpRequest) request).getRequestLine().toString(); Pattern pattern = LoggingUtils.getSkipLoggingMatcher(); if (pattern != null && !pattern.matcher(uri).find()) { printLog(message); } } else { printLog(message); } } if (message != null && accesslog.isInfoEnabled()) { HttpRequest request = (HttpRequest) message; HttpParams params = request.getParams(); final SocketAddress remoteAddress = session.getRemoteAddress(); if (remoteAddress instanceof InetSocketAddress) { final InetSocketAddress remote = (( InetSocketAddress) remoteAddress); params.setParameter("http.remote.addr", remote.getAddress().getHostAddress()); } AccessHandler.getAccess().addAccessToQueue(message); } this.writer.write(message); }
@Override public void submitResponse(final HttpResponse response) throws IOException, HttpException { Args.notNull(response, "HTTP response"); assertNotClosed(); if (this.response != null) { throw new HttpException("Response already submitted"); } onResponseSubmitted(response); this.responseWriter.write(response); this.hasBufferedOutput = this.outbuf.hasData(); if (response.getStatusLine().getStatusCode() >= 200) { this.connMetrics.incrementResponseCount(); if (response.getEntity() != null) { this.response = response; prepareEncoder(response); } } this.session.setEvent(EventMask.WRITE); }
@Override public void submitResponse(final HttpResponse response) throws IOException, HttpException { Args.notNull(response, "HTTP response"); assertNotClosed(); if (this.response != null) { throw new HttpException("Response already submitted"); } onResponseSubmitted(response); this.responseWriter.write(response); this.hasBufferedOutput = this.outbuf.hasData(); if (response.getStatusLine().getStatusCode() >= 200) { this.connMetrics.incrementResponseCount(); if (response.getEntity() != null) { this.response = response; prepareEncoder(response); } } this.session.setEvent(EventMask.WRITE); }
@Override public void submitRequest(final HttpRequest request) throws IOException, HttpException { Args.notNull(request, "HTTP request"); assertNotClosed(); if (this.request != null) { throw new HttpException("Request already submitted"); } onRequestSubmitted(request); this.requestWriter.write(request); this.hasBufferedOutput = this.outbuf.hasData(); if (request instanceof HttpEntityEnclosingRequest && ((HttpEntityEnclosingRequest) request).getEntity() != null) { prepareEncoder(request); this.request = request; } this.connMetrics.incrementRequestCount(); this.session.setEvent(EventMask.WRITE); }
@Override public void submitRequest(final HttpRequest request) throws IOException, HttpException { Args.notNull(request, "HTTP request"); assertNotClosed(); if (this.request != null) { throw new HttpException("Request already submitted"); } onRequestSubmitted(request); this.requestWriter.write(request); this.hasBufferedOutput = this.outbuf.hasData(); if (request instanceof HttpEntityEnclosingRequest && ((HttpEntityEnclosingRequest) request).getEntity() != null) { prepareEncoder(request); this.request = request; } this.connMetrics.incrementRequestCount(); this.session.setEvent(EventMask.WRITE); }