Skip to content

Commit

Permalink
Merge pull request #555 from hypnopadge/RESTEASY-1095-OPTION-1
Browse files Browse the repository at this point in the history
RESTEASY-1095-OPTION-1
  • Loading branch information
patriot1burke committed Aug 19, 2014
2 parents be6321b + 6b77d75 commit ab570b5
Showing 1 changed file with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
import io.netty.handler.codec.MessageToMessageDecoder;
import io.netty.handler.codec.http.HttpContent;
import io.netty.handler.codec.http.HttpHeaders;
import io.netty.util.ReferenceCountUtil;

import org.jboss.resteasy.core.SynchronousDispatcher;
import org.jboss.resteasy.logging.Logger;
import org.jboss.resteasy.specimpl.ResteasyHttpHeaders;
Expand Down Expand Up @@ -70,9 +72,15 @@ protected void decode(ChannelHandlerContext ctx, io.netty.handler.codec.http.Htt
{
HttpContent content = (HttpContent) request;
ByteBuf buf = content.content().retain();
ByteBufInputStream in = new ByteBufInputStream(buf);
nettyRequest.setInputStream(in);
out.add(nettyRequest);
try {
ByteBufInputStream in = new ByteBufInputStream(buf);
nettyRequest.setInputStream(in);
out.add(nettyRequest);
}
finally
{
ReferenceCountUtil.release(buf);
}
}
}
catch (Exception e)
Expand Down

0 comments on commit ab570b5

Please sign in to comment.