Netflix/RxNetty — pull request #132 by NiteshKant (2014-05-31 18:29:01+00:00)
Title: Fixes issues #129 #130 #131

#129: The issue here was that as part of sending (onNext()) the first response (redirect response), we were submitting the redirect request.
If the connection is reused (for connection pool), it resets the content subject (reacting to ConnectionReuseEvent) in ClientRequestResponseConverter.
The ClientRequestResponseConverter was referring to the "current content subject" while invoking an onComplete(), which is invoked when the content on the first response is over.
Now, in the above situation, since the content subject is changed between processing headers and processing content (in the same method), the onComplete() is called on the content subject of the second response and not the first as it is expected.

The fix is two folds:

1) Move the redirect call in RedirectOperator to onComplete()/onError() of the first observer.
2) In ClientRequestResponseConverter use the subject that was present when the channelRead() was received and do not refer to the instance level state of the subject.

From the perspective of this bug, 1) is sufficient but 2) is the correct way of handling the shared state.

#130: The LastHttpContent was not sent for Keep-alive requests with no chunked encoding.

#131: Fixed the redirect loop and infinite redirects detection in the RedirectOperator.