Skip to content

Commit

Permalink
4107: Close response body after request
Browse files Browse the repository at this point in the history
  • Loading branch information
andrey-qlogic committed Nov 30, 2018
1 parent a7703f2 commit 3550f81
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -681,14 +681,19 @@ public void write(String uploadId, byte[] toWrite, int toWriteOffset, long destO
int code;
String message;
IOException exception = null;
HttpResponse response = null;
try {
HttpResponse response = httpRequest.execute();
response = httpRequest.execute();
code = response.getStatusCode();
message = response.getStatusMessage();
} catch (HttpResponseException ex) {
exception = ex;
code = ex.getStatusCode();
message = ex.getStatusMessage();
} finally {
if (response != null ) {
response.disconnect();
}
}
if (!last && code != 308 || last && !(code == 200 || code == 201)) {
if (exception != null) {
Expand Down

0 comments on commit 3550f81

Please sign in to comment.