/* * (non-Javadoc) * * @see org.owasp.proxy.daemon.HttpRequestHandler#handleRequest(java.net.InetAddress , * org.owasp.httpclient.StreamingRequest) */ public StreamingResponse handleRequest( final InetAddress source, StreamingRequest request, boolean isContinue) throws IOException, MessageFormatException { MutableBufferedRequest req = new MutableBufferedRequest.Impl(); MutableBufferedResponse resp = new MutableBufferedResponse.Impl(); ConversationObserver observer = new ConversationObserver(source, req, resp); MessageUtils.delayedCopy(request, req, max, observer.getRequestObserver()); StreamingResponse response = next.handleRequest(source, request, isContinue); MessageUtils.delayedCopy(response, resp, max, observer.getResponseObserver()); return response; }
public static void delayedCopy( final StreamingResponse message, final MutableBufferedResponse copy, int max, final DelayedCopyObserver observer) { copy.setHeaderTime(message.getHeaderTime()); delayedCopy( (StreamingMessage) message, (MutableBufferedMessage) copy, max, new DelayedCopyObserver() { @Override public void copyCompleted(boolean overflow, int size) { copy.setHeaderTime(message.getHeaderTime()); copy.setContentTime(message.getContentTime()); observer.copyCompleted(overflow, size); } }); }
public static void delayedCopy( final StreamingRequest message, final MutableBufferedRequest copy, int max, final DelayedCopyObserver observer) { copy.setTarget(message.getTarget()); copy.setSsl(message.isSsl()); delayedCopy( (StreamingMessage) message, (MutableBufferedMessage) copy, max, new DelayedCopyObserver() { @Override public void copyCompleted(boolean overflow, int size) { copy.setTime(message.getTime()); observer.copyCompleted(overflow, size); } }); }