|
|
@ -226,17 +226,25 @@ public class HttpClientConnection implements HttpConnection { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private void execute() throws IOException, ClientProtocolException { |
|
|
|
private void execute() throws IOException, ClientProtocolException { |
|
|
|
if (resp == null) |
|
|
|
if (resp != null) { |
|
|
|
if (entity != null) { |
|
|
|
return; |
|
|
|
if (req instanceof HttpEntityEnclosingRequest) { |
|
|
|
} |
|
|
|
HttpEntityEnclosingRequest eReq = (HttpEntityEnclosingRequest) req; |
|
|
|
|
|
|
|
eReq.setEntity(entity); |
|
|
|
if (entity == null) { |
|
|
|
} |
|
|
|
resp = getClient().execute(req); |
|
|
|
resp = getClient().execute(req); |
|
|
|
return; |
|
|
|
entity.getBuffer().close(); |
|
|
|
} |
|
|
|
entity = null; |
|
|
|
|
|
|
|
} else |
|
|
|
try { |
|
|
|
resp = getClient().execute(req); |
|
|
|
if (req instanceof HttpEntityEnclosingRequest) { |
|
|
|
|
|
|
|
HttpEntityEnclosingRequest eReq = (HttpEntityEnclosingRequest) req; |
|
|
|
|
|
|
|
eReq.setEntity(entity); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
resp = getClient().execute(req); |
|
|
|
|
|
|
|
} finally { |
|
|
|
|
|
|
|
entity.close(); |
|
|
|
|
|
|
|
entity = null; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public Map<String, List<String>> getHeaderFields() { |
|
|
|
public Map<String, List<String>> getHeaderFields() { |
|
|
|