You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2016/05/17 17:11:10 UTC

[Bug 59564] New: HttpServletRequest.getPart() always returns null with HTTP/2

https://bz.apache.org/bugzilla/show_bug.cgi?id=59564

            Bug ID: 59564
           Summary: HttpServletRequest.getPart() always returns null with
                    HTTP/2
           Product: Tomcat 8
           Version: 8.5.x-trunk
          Hardware: Macintosh
            Status: NEW
          Severity: major
          Priority: P2
         Component: Connectors
          Assignee: dev@tomcat.apache.org
          Reporter: thad.humphries@gmail.com

If I enable HTTP/2 via UpgradeProtocol, HttpServletRequest.getPart() always
returns null. This occurs in my own code as well as in
org.apache.catalina.manager.HTMLManagerServlet (so, a *.WAR cannot be deployed
if HTTP/2 is enabled). When <UpgradeProtocol...> is commented out, upload
works.

My connector is

<!-- NIO connector with OpenSSL -->
<Connector port="8443" protocol="org.apache.coyote.http11.Http11NioProtocol"
           maxThreads="200" SSLEnabled="true" compression="on"
           scheme="https" secure="true">
  <UpgradeProtocol className="org.apache.coyote.http2.Http2Protocol" />
  <SSLHostConfig honorCipherOrder="false">
    <Certificate certificateKeyFile="conf/foo-nopp.pem"
                 certificateFile="conf/foo.pem"
                 type="RSA" />
  </SSLHostConfig>
</Connector>

The failure occurs with either Http11NioProtocol or Http11Nio2Protocol.

I'm am running Tomcat 8.5, Java 1.8.0_91, MacOS 10.10.5, and both Chrome 50 and
Firefox 46.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 59564] HttpServletRequest.getPart() always returns null with HTTP/2

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=59564

Mark Thomas <ma...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|NEW                         |RESOLVED

--- Comment #5 from Mark Thomas <ma...@apache.org> ---
Reproducible with:
- Clean 9.0.x build
- NIO + OpenSSL + HTTP/2
- ~40MB WAR (Spring Pet Clinic)

Violeta's patch fixes this so I have applied it to 9.0.x for 9.0.0.M7 onwards
and 8.5.x for 8.5.3 onwards.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 59564] HttpServletRequest.getPart() always returns null with HTTP/2

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=59564

--- Comment #3 from Remy Maucherat <re...@apache.org> ---
No idea at this point. I guess it will be explained eventually.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 59564] HttpServletRequest.getPart() always returns null with HTTP/2

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=59564

Violeta Georgieva <vi...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEEDINFO                    |NEW

--- Comment #4 from Violeta Georgieva <vi...@apache.org> ---
Hi,

I was able to reproduce this issue.

I think that we should invoke 'data.arrayOffset() + data.position()' when we
fill the data:


Index: Http2Parser.java
===================================================================
--- Http2Parser.java    (revision 1745545)
+++ Http2Parser.java    (working copy)
@@ -561,7 +561,7 @@
         }

         default boolean fill(boolean block, ByteBuffer data, int len) throws
IOException {
-            boolean result = fill(block, data.array(), data.arrayOffset(),
len);
+            boolean result = fill(block, data.array(), data.arrayOffset() +
data.position(), len);
             if (result) {
                 data.position(data.position() + len);
             }

What do you think?

Regards,
Violeta

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 59564] HttpServletRequest.getPart() always returns null with HTTP/2

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=59564

--- Comment #2 from Thad Humphries <th...@gmail.com> ---
Rats. I was afraid that's what I'd be told. Is something wrong with my
connector? The cert is self-signed. Does that matter?

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 59564] HttpServletRequest.getPart() always returns null with HTTP/2

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=59564

Remy Maucherat <re...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 OS|                            |All
             Status|NEW                         |NEEDINFO

--- Comment #1 from Remy Maucherat <re...@apache.org> ---
This works for me (can't sat anything else really).

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org