setDefaultParams();
}
// Set default parameters as needed
private static void setDefaultParams(){
HttpParams params = DefaultHttpParams.getDefaultParams();
// Process httpclient parameters file
String file=JMeterUtils.getProperty("httpclient.parameters.file"); // $NON-NLS-1$
if (file != null) {
HttpClientDefaultParameters.load(file,params);
}
// If the pre-emptive parameter is undefined, then we cans set it as needed
// otherwise we should do what the user requested.
canSetPreEmptive = params.getParameter(HTTP_AUTHENTICATION_PREEMPTIVE) == null;
// Handle old-style JMeter properties
// Default to HTTP version 1.1
String ver=JMeterUtils.getPropDefault("httpclient.version","1.1"); // $NON-NLS-1$ $NON-NLS-2$
try {
params.setParameter(HttpMethodParams.PROTOCOL_VERSION, HttpVersion.parse("HTTP/"+ver));
} catch (ProtocolException e) {
log.warn("Problem setting protocol version "+e.getLocalizedMessage());
}
String to= JMeterUtils.getProperty("httpclient.timeout");
if (to != null){
params.setIntParameter(HttpMethodParams.SO_TIMEOUT, Integer.parseInt(to));
}
// This must be done last, as must not be overridden
params.setParameter(HttpMethodParams.COOKIE_POLICY,CookiePolicy.IGNORE_COOKIES);
// We do our own cookie handling
}