File tree 1 file changed +2
-8
lines changed
client/src/main/java/org/asynchttpclient/netty/request/body
1 file changed +2
-8
lines changed Original file line number Diff line number Diff line change @@ -53,14 +53,8 @@ public long getContentLength() {
53
53
public void write (final Channel channel , NettyResponseFuture <?> future ) {
54
54
55
55
Object msg ;
56
- if (body instanceof RandomAccessBody && !ChannelManager .isSslHandlerConfigured (channel .pipeline ()) && !config .isDisableZeroCopy ()) {
57
- long contentLength = getContentLength ();
58
- if (contentLength < 0 ) {
59
- // contentLength unknown in advance, use chunked input
60
- msg = new BodyChunkedInput (body );
61
- } else {
62
- msg = new BodyFileRegion ((RandomAccessBody ) body );
63
- }
56
+ if (body instanceof RandomAccessBody && !ChannelManager .isSslHandlerConfigured (channel .pipeline ()) && !config .isDisableZeroCopy () && getContentLength () > 0 ) {
57
+ msg = new BodyFileRegion ((RandomAccessBody ) body );
64
58
65
59
} else {
66
60
msg = new BodyChunkedInput (body );
You can’t perform that action at this time.
0 commit comments