Skip to content

Commit

Permalink
4107: Disconnect response 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 2e73e08
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
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
2 changes: 1 addition & 1 deletion google-cloud-clients/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@
<github.global.server>github</github.global.server>
<site.installationModule>google-cloud-clients</site.installationModule>
<bom.version>0.72.0-alpha</bom.version><!-- {x-version-update:google-cloud-bom:current} -->
<api-client.version>1.27.0</api-client.version>
<api-client.version>1.27.1-SNAPSHOT</api-client.version>
<gax.version>1.35.0</gax.version>
<google.auth.version>0.12.0</google.auth.version>
<grpc.version>1.16.1</grpc.version>
Expand Down

0 comments on commit 2e73e08

Please sign in to comment.