jmeter-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Philippe Mouawad <philippe.moua...@gmail.com>
Subject Re: svn commit: r1303688 - /jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/PostWriter.java
Date Thu, 22 Mar 2012 12:01:09 GMT
Hello,
with previous code, we might hid initial exception.
Do you really think an exception on close is useful ?

Regards
Philippe


On Thu, Mar 22, 2012 at 12:54 PM, sebb <sebbaz@gmail.com> wrote:

> On 22 March 2012 08:50,  <pmouawad@apache.org> wrote:
> > Author: pmouawad
> > Date: Thu Mar 22 08:50:29 2012
> > New Revision: 1303688
> >
> > URL: http://svn.apache.org/viewvc?rev=1303688&view=rev
> > Log:
> > Made method static and used closeQuietly
> >
> > Modified:
> >
>  jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/PostWriter.java
> >
> > Modified:
> jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/PostWriter.java
> > URL:
> http://svn.apache.org/viewvc/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/PostWriter.java?rev=1303688&r1=1303687&r2=1303688&view=diff
> >
> ==============================================================================
> > ---
> jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/PostWriter.java
> (original)
> > +++
> jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/PostWriter.java
> Thu Mar 22 08:50:29 2012
> > @@ -33,6 +33,7 @@ import org.apache.jmeter.protocol.http.u
> >  import org.apache.jmeter.protocol.http.util.HTTPFileArg;
> >  import org.apache.jmeter.samplers.SampleResult;
> >  import org.apache.jmeter.testelement.property.PropertyIterator;
> > +import org.apache.jorphan.util.JOrphanUtils;
> >
> >  /**
> >  * Class for setting the necessary headers for a POST request, and
> sending the
> > @@ -398,7 +399,7 @@ public class PostWriter {
> >      * @param out the stream to write to
> >      * @throws IOException
> >      */
> > -    private void writeFileToStream(String filename, OutputStream out)
> throws IOException {
> > +    private static void writeFileToStream(String filename, OutputStream
> out) throws IOException {
> >         byte[] buf = new byte[1024];
> >         // 1k - the previous 100k made no sense (there's tons of buffers
> >         // elsewhere in the chain) and it caused OOM when many concurrent
> > @@ -412,7 +413,7 @@ public class PostWriter {
> >             }
> >         }
> >         finally {
> > -            in.close();
> > +            JOrphanUtils.closeQuietly(in);
>
> I'm not sure we want to ignore errors here.
>
> >         }
> >     }
> >
> >
> >
>



-- 
Cordialement.
Philippe Mouawad.

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message