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

DefaultNHttpServerConnection.consumeInput() stops reading

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 4.0-alpha5
    • 4.0-alpha6
    • HttpCore NIO
    • None

    Description

      If the underlying channel has more data buffered than can be read into inbuf DefaultNHttpServerConnection.consumeInput() will return and relies on the selector to timeout to read the remaining part of the request. I suggest to make the parsing code more greedy:

      int bytesRead;
      while ((bytesRead = this.requestParser.fillBuffer(this.session.channel())) > 0 && this.request == null) {
      if (bytesRead > 0)

      { this.inTransportMetrics.incrementBytesTransferred(bytesRead); }

      this.request = (HttpRequest) this.requestParser.parse();
      }

      Attachments

        1. httpcore-greedy-message-parsing.patch
          9 kB
          Steffen Pingel
        2. httpcore-greedy-message-parsing.patch
          9 kB
          Steffen Pingel
        3. TestBaseIOReactorSSL.java
          5 kB
          Steffen Pingel

        Activity

          People

            Unassigned Unassigned
            spingel Steffen Pingel
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: