public static HTTPSampleResult sample(HTTPAbstractImpl impl, URL u, String method, boolean areFollowingRedirect, int depth) { return impl.sample(u, method, areFollowingRedirect, depth); } }
@Override public boolean interrupt() { if (impl != null) { return impl.interrupt(); // Forward to sampler } return false; }
@Override public void testIterationStart(LoopIterationEvent event) { if (impl != null) { impl.notifyFirstSampleAfterLoopRestart(); } } }
@Override public void threadFinished(){ if (impl != null){ impl.threadFinished(); // Forward to sampler } }
/** * Read response from the input stream, converting to MD5 digest if the * useMD5 property is set. * <p> * For the MD5 case, the result byte count is set to the size of the * original response. * <p> * Closes the inputStream * <p> * Invokes * {@link HTTPSamplerBase#readResponse(SampleResult, InputStream, long)} * * @param res * sample to store information about the response into * @param instream * input stream from which to read the response * @param responseContentLength * expected input length or zero * @return the response or the MD5 of the response * @throws IOException * if reading the result fails */ protected byte[] readResponse(SampleResult res, InputStream instream, int responseContentLength) throws IOException { return readResponse(res, instream, (long)responseContentLength); } /**
final String ipSource = getIpSource(); if (ipSource.trim().length() > 0) { Class<? extends InetAddress> ipClass = null;
/** {@inheritDoc} */ @Override protected HTTPSampleResult sample(URL u, String method, boolean areFollowingRedirect, int depth) { // When Retrieve Embedded resources + Concurrent Pool is used // as the instance of Proxy is cloned, we end up with impl being null // testIterationStart will not be executed but it's not a problem for 51380 as it's download of resources // so SSL context is to be reused if (impl == null) { // Not called from multiple threads, so this is OK try { impl = HTTPSamplerFactory.getImplementation(getImplementation(), this); } catch (Exception ex) { return errorResult(ex, new HTTPSampleResult()); } } return impl.sample(u, method, areFollowingRedirect, depth); }