You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@solr.apache.org by GitBox <gi...@apache.org> on 2021/09/02 19:17:29 UTC

[GitHub] [solr] HoustonPutman commented on a change in pull request #283: SOLR-14457: Fix closing of malformed GZIPInputStream

HoustonPutman commented on a change in pull request #283:
URL: https://github.com/apache/solr/pull/283#discussion_r701356957



##########
File path: solr/solrj/src/java/org/apache/solr/client/solrj/impl/HttpClientUtil.java
##########
@@ -447,14 +448,39 @@ public void process(final HttpResponse response, final HttpContext context)
     }
   }
   
-  private static class GzipDecompressingEntity extends HttpEntityWrapper {
+  protected static class GzipDecompressingEntity extends HttpEntityWrapper {
+    private boolean gzipInputStreamCreated = false;
+    private InputStream gzipInputStream = null;
+
     public GzipDecompressingEntity(final HttpEntity entity) {
       super(entity);
     }
-    
+
+    /**
+     * Return a InputStream of uncompressed data.
+     * If there is an issue with the compression of the data, a null InputStream will be returned,
+     * and the underlying compressed InputStream will be closed.
+     *
+     * The same input stream will be returned if the underlying entity is not repeatable.
+     * If the underlying entity is repeatable, then a new input stream will be created.

Review comment:
       I'm not exactly sure. I just included the option so that I don't have to confirm that we can expect a repeatable entity every time. I can add a better test for it, instead of just testing the failures




-- 
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@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org