Uploaded image for project: 'Undertow'
  1. Undertow
  2. UNDERTOW-247

EagerFormParsingHandler is not compatible with HttpServerExchange#dispatch

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Minor Minor
    • 1.1.Beta2
    • 1.0.14.Final
    • Core
    • None

      The class io.undertow.server.handlers.form.EagerFormParsingHandler could be used as a HttpHandler to parse the POST data into a FormData object.

      The implementation is not compatible with the dispatch mechanism to move the work from the IO threads to worker threads. The form parser will call Connectors#executeRootHandler to delegate to the registered next handler as soon as POST data was successfully parsed into the FormData object.
      The call to Connectors#executeRootHandler will start a new independent handler chain for the next handler. This handler will dispatch its work and exits its execution on the IO thread. You now have two handler chains which will exit its execution. One will find the dispatched task, while the other one won't get any information about it and completes with a call to HttpServerExchange#endExchange. As soon as the dispatched task will be executed, you are unable to modify headers, etc as endExchange on HttpServerExchange was already called.

              sdouglas1@redhat.com Stuart Douglas (Inactive)
              ste_gr Stefan Gr (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: