summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteffen Pingel2012-11-24 19:20:11 (EST)
committer Steffen Pingel2012-11-25 14:42:52 (EST)
commit9cef8f2ab98c19853cb9a5d0c5d451180316fde6 (patch)
tree3d251b824e2c270706f2163cae4f78be603f6cf2
parent7c4f29da78b11269f79ee30ad41b5f968be1e55f (diff)
downloadorg.eclipse.mylyn.tasks-9cef8f2ab98c19853cb9a5d0c5d451180316fde6.zip
org.eclipse.mylyn.tasks-9cef8f2ab98c19853cb9a5d0c5d451180316fde6.tar.gz
org.eclipse.mylyn.tasks-9cef8f2ab98c19853cb9a5d0c5d451180316fde6.tar.bz2
388897: fix connection leak when downloading attachment content
Change-Id: Ic924bbfc68ecb7b2047606586587beb1f424d8bd Task-Url: https://bugs.eclipse.org/bugs/show_bug.cgi?id=388897
-rw-r--r--org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaClient.java7
1 files changed, 2 insertions, 5 deletions
diff --git a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaClient.java b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaClient.java
index c88e6eb..5666a33 100644
--- a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaClient.java
+++ b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaClient.java
@@ -815,10 +815,9 @@ public class BugzillaClient {
public void getAttachmentData(String attachmentId, OutputStream out, IProgressMonitor monitor) throws IOException,
CoreException {
String url = repositoryUrl + IBugzillaConstants.URL_GET_ATTACHMENT_DOWNLOAD + attachmentId;
- GetMethod method = connectInternal(url, false, monitor, null);//getConnectGzip(url, monitor);
+ GetMethod method = getConnect(url, monitor);//getConnectGzip(url, monitor);
try {
- int status = WebUtil.execute(httpClient, hostConfiguration, method, monitor);
- if (status == HttpStatus.SC_OK) {
+ if (method.getStatusCode() == HttpStatus.SC_OK) {
//copy the response
InputStream instream = method.getResponseBodyAsStream();
if (instream != null) {
@@ -831,8 +830,6 @@ public class BugzillaClient {
} else {
parseHtmlError(method.getResponseBodyAsStream());
}
- } catch (IOException e) {
- throw e;
} finally {
WebUtil.releaseConnection(method, monitor);
}