tyrus
  1. tyrus
  2. TYRUS-201

Wrong ServletInputStream#isReady() usage in TyrusHttpUpgradeHandler

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.3
    • Component/s: None
    • Labels:
      None

      Description

              } finally {
                  if (is.isReady()) {
                      LOGGER.log(Level.SEVERE, "This shouldn't happen. ServletInputStream.isReady() returned true after reading all available() data.");
                  } else {
                      // everything is ok, all data consumed, waiting for next onDataAvailable call from web-core
                  }
              }
      

      It is not an error that isReady() returns true. There is a window where data can be available after the call available() and before isReady() is called.

      While isReady() returns true, you need to loop and read the data. Otherwise, the container won't call onDataAvailable() again. See the javadoc of ServerInputStream

        Activity

          People

          • Assignee:
            Pavel Bucek
            Reporter:
            jitu
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: