summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteffen Pingel2012-11-24 19:20:11 (EST)
committer Steffen Pingel2012-11-25 15:12:23 (EST)
commit7095e262f77af86e380190b9c32ba145b7b2fc66 (patch)
treef45d6c0bf628293cb6bf08d41f16aa3acb5cd48b
parenta0a8c2a45b5e20512e273dbec52595bb3bb1b1be (diff)
downloadorg.eclipse.mylyn.tasks-7095e262f77af86e380190b9c32ba145b7b2fc66.zip
org.eclipse.mylyn.tasks-7095e262f77af86e380190b9c32ba145b7b2fc66.tar.gz
org.eclipse.mylyn.tasks-7095e262f77af86e380190b9c32ba145b7b2fc66.tar.bz2
388897: fix connection leak when downloading attachment contentrefs/changes/46/8846/2
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 ac0e8df..d11bc1f 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);
}