code: private void checkSize(long newSize, long maxSize, HttpServerFileUpload upload) {
          if (maxSize >= 0 && newSize > maxSize) {
              upload.handler(null);
              report(new IllegalStateException("Size exceed allowed maximum capacity"));
          }
      }
docs: Checks whether we exceed the max allowed file size.
  
  @param newSize the expected size once the current chunk is consumed
  @param maxSize the max allowed size.
  @param upload  the upload