Hi Folks, I've got a situation where an HttpResponse can come without a content-length set, but the application can determine when the entity is 'finished' through reading it. In HttpCore this is solvable by closing the InputStream after reading what you need. (It will use an IdentityInputStream, and closing it is symantically equivalent to ContentLengthInputStream reading its alloted length.) In HttpCore-NIO, I don't see a way to do this. What about adding a new interface, something like CompletableContentDecoder that extends ContentDecoder, and having IdentityDecoder implement it -- the only additional method would be 'setCompleted', and it would set completed to true. (Or just expose the method on IdentityDecoder and look for that specific class.) This'd let the rest of the NIO system know that the decoder was finished. An alternate approach is to add some hook where the decoder is prepared to return your own kind of decoder... but given that the blocking variant of httpcore lets you do this easily on the stream/decoder, I think it makes sense for the non-blocking variant to let it happen.
So, I'll go for the easy approach... one additional method on IdentityDecoder: setCompleted(boolean) that sets completed. Think we could sneak this one into beta2? (Also, let me know if it's OK to just commit a change like this without talk.) Thanks. Sam --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
