glassfish
  1. glassfish
  2. GLASSFISH-17332

Server reads all post data from client despite of maxPostSize limit

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: v3.0.1
    • Fix Version/s: 3.1.2_b02
    • Component/s: grizzly-kernel
    • Labels:
      None

      Description

      I face to a problem to limit post size of request, when file uploading from browser

      When server process a request on file uploading, servlet throw error when request file size is bigger when limit (multipart config size limit from servlet 3.0 or other size limitation option)

      But after that ProcessorTask class do the finishResponse method and do the inputBuffer.endRequest()

      This method read all data from client (for example we upload 2GB file, servlet upload 30 Mb, throw exception on limit, and after that glassfish read remaining 1970Mb of data)

      When url is not exist (404 error) ProcessorTask also read all file from client (more then limit) and after that shows an 404 error.

      It is not a normal.

      My question is a how to break connection on glassfish to avoid a full file uploading?

      Should glassfish break connection on size limit (max-post-size, multipart config file size limit)?

      glassfish 3.0.1

        Issue Links

          Activity

          Hide
          oleksiys added a comment -

          correspondent Grizzly issue
          http://java.net/jira/browse/GRIZZLY-1094

          Show
          oleksiys added a comment - correspondent Grizzly issue http://java.net/jira/browse/GRIZZLY-1094
          Hide
          oleksiys added a comment -

          corresponding grizzly issue is fixed.
          It will be possible to limit the max number of bytes GF will read from the current HTTP request remainder before deciding to close terminate the connection.

          The limit will be possible to set manually by editing domain.xml file. For example in order to limit the mentioned max value to 16K - you can set

          <http default-virtual-server="server" max-connections="250" max-swallowing-input-bytes="16384">
          <file-cache></file-cache>
          </http>

          default value is -1, which keeps the original (unlimited) behavior.

          Show
          oleksiys added a comment - corresponding grizzly issue is fixed. It will be possible to limit the max number of bytes GF will read from the current HTTP request remainder before deciding to close terminate the connection. The limit will be possible to set manually by editing domain.xml file. For example in order to limit the mentioned max value to 16K - you can set <http default-virtual-server="server" max-connections="250" max-swallowing-input-bytes="16384" > <file-cache></file-cache> </http> default value is -1, which keeps the original (unlimited) behavior.
          Hide
          oleksiys added a comment -

          fixed.
          will become available with 1.9.37 integration
          http://java.net/jira/browse/GLASSFISH-17270

          Show
          oleksiys added a comment - fixed. will become available with 1.9.37 integration http://java.net/jira/browse/GLASSFISH-17270

            People

            • Assignee:
              oleksiys
              Reporter:
              kudrin777
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: