hi,everybody,
    I was planning to make my apis support 304 response with restlet and
netty extension(2.0.11). However, netty extension has a bug for dealing with
restlet response of 304(with null entity). I debuged and found the code with
this bug:
File: HttpRequestHandler.java
Line: 215
Code:
                    if (responseEntity != null) {
                        if (nettyResponse.isChunked()) {
                            nettyResponse.setContent(null);
                            future = ch.write(nettyResponse);
                            ch.write(new ChunkedStream(restletResponse
                                    .getEntity().getStream()));
                        } else {
                            ChannelBuffer buf = dynamicBuffer();
                            buf.writeBytes(responseEntity.getStream(),
                                    (int)
responseEntity.getAvailableSize());
                            nettyResponse.setContent(buf);
                            future = ch.write(nettyResponse);
                        }
                    }
Explanation:
    for 304 response, restlet set the entity with null value, and as a
result nettyResponse will never get sent.

hope this bug will be fixed in netty extension 2.1. Restlet core can also
fix this bug by set 304 entity to empty representation not null.


--
View this message in context: 
http://restlet-discuss.1400322.n2.nabble.com/Netty-extension-for-304-support-with-restlet-tp7316840p7316840.html
Sent from the Restlet Discuss mailing list archive at Nabble.com.

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2926521

Reply via email to