You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "beise (via GitHub)" <gi...@apache.org> on 2023/09/20 11:29:08 UTC
[GitHub] [commons-vfs] beise opened a new pull request, #428: VFS-849: Release httpConnection resources properly ...
beise opened a new pull request, #428:
URL: https://github.com/apache/commons-vfs/pull/428
by consuming the entire HttpEntity
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@commons.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [commons-vfs] garydgregory merged pull request #428: VFS-849: Release httpConnection resources properly ...
Posted by "garydgregory (via GitHub)" <gi...@apache.org>.
garydgregory merged PR #428:
URL: https://github.com/apache/commons-vfs/pull/428
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@commons.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [commons-vfs] beise commented on a diff in pull request #428: VFS-849: Release httpConnection resources properly ...
Posted by "beise (via GitHub)" <gi...@apache.org>.
beise commented on code in PR #428:
URL: https://github.com/apache/commons-vfs/pull/428#discussion_r1331584578
##########
commons-vfs2-jackrabbit2/src/main/java/org/apache/commons/vfs2/provider/webdav4/Webdav4FileObject.java:
##########
@@ -487,11 +488,17 @@ private HttpResponse executeRequest(final HttpUriRequest request) throws FileSys
response = executeHttpUriRequest(request);
final int status = response.getStatusLine().getStatusCode();
if (status == HttpURLConnection.HTTP_NOT_FOUND || status == HttpURLConnection.HTTP_GONE) {
+ EntityUtils.consume(response.getEntity());
throw new FileNotFoundException(request.getURI());
}
if (request instanceof BaseDavRequest) {
- ((BaseDavRequest) request).checkSuccess(response);
+ try {
+ ((BaseDavRequest) request).checkSuccess(response);
+ } catch(DavException e){
+ EntityUtils.consume(response.getEntity());
Review Comment:
Hi @garydgregory
you are right! This change is indeed unnecessary.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@commons.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [commons-vfs] garydgregory commented on a diff in pull request #428: VFS-849: Release httpConnection resources properly ...
Posted by "garydgregory (via GitHub)" <gi...@apache.org>.
garydgregory commented on code in PR #428:
URL: https://github.com/apache/commons-vfs/pull/428#discussion_r1331539191
##########
commons-vfs2-jackrabbit2/src/main/java/org/apache/commons/vfs2/provider/webdav4/Webdav4FileObject.java:
##########
@@ -487,11 +488,17 @@ private HttpResponse executeRequest(final HttpUriRequest request) throws FileSys
response = executeHttpUriRequest(request);
final int status = response.getStatusLine().getStatusCode();
if (status == HttpURLConnection.HTTP_NOT_FOUND || status == HttpURLConnection.HTTP_GONE) {
+ EntityUtils.consume(response.getEntity());
throw new FileNotFoundException(request.getURI());
}
if (request instanceof BaseDavRequest) {
- ((BaseDavRequest) request).checkSuccess(response);
+ try {
+ ((BaseDavRequest) request).checkSuccess(response);
+ } catch(DavException e){
+ EntityUtils.consume(response.getEntity());
Review Comment:
Hello @beise
Isn't the response consumed in `org.apache.jackrabbit.webdav.client.methods.BaseDavRequest.getResponseException(HttpResponse)` by calling `org.apache.jackrabbit.webdav.client.methods.BaseDavRequest.getResponseBodyAsDocument(HttpEntity)` before throwing `DavException`?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@commons.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org