Uploaded image for project: 'HttpComponents HttpCore'
  1. HttpComponents HttpCore
  2. HTTPCORE-655

IdentityInputStream javadoc regarding close() does not match implementation

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 4.4.14, 5.0.3
    • 5.1-beta3, 5.1
    • None
    • None

    Description

      The documentation for IdentityInputStream says:

      Note that this class NEVER closes the underlying stream, even when close gets called. Instead, it will read until the end of the stream (until -1 is returned).

      Similarly the tutorials also say:

      [closing the content stream] will attempt to keep the underlying connection alive by consuming the entity content

      However, it appears that is not actually true. The implementation does not try to read the remaining content.

      Note however, that changing this might break existing applications because it appears not many users are aware of this behavior (which can be seen by the number of reports about ChunkedInputStream.close() blocking forever).

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            Unassigned Unassigned
            Marcono1234 Marcono1234
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment