-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

All,

I recently had the displeasure of tracking-down a mismatched AJP "max
packet size" on a service. The symptom was that when a large POST
request came in ( > 8192 bytes ), Tomcat would log two errors in quick
succession:

1. org.apache.catalina.connector.ClientAbortException:
java.io.IOException: Invalid message received with length [-1]
        at
org.apache.catalina.connector.InputBuffer.realReadBytes(InputBuffer.java
:348)
        at
org.apache.catalina.connector.InputBuffer.checkByteBufferEof(InputBuffer
.java:663)
        at
org.apache.catalina.connector.InputBuffer.read(InputBuffer.java:370)
        at
org.apache.catalina.connector.CoyoteInputStream.read(CoyoteInputStream.j
ava:183)


and then immediately:

2. java.lang.IllegalArgumentException: Header message of length
[8,194] received but the packetSize is only [8,192]
        at
org.apache.coyote.ajp.AjpProcessor.readMessage(AjpProcessor.java:685)
        at
org.apache.coyote.ajp.AjpProcessor.receive(AjpProcessor.java:626)
        at
org.apache.coyote.ajp.AjpProcessor.refillReadBuffer(AjpProcessor.java:73
4)
        at
org.apache.coyote.ajp.AjpProcessor$SocketInputBuffer.doRead(AjpProcessor
.java:1456)
        at org.apache.coyote.Request.doRead(Request.java:581)
        at
org.apache.catalina.connector.InputBuffer.realReadBytes(InputBuffer.java
:344)
        at
org.apache.catalina.connector.InputBuffer.checkByteBufferEof(InputBuffer
.java:663)
        at
org.apache.catalina.connector.InputBuffer.readByte(InputBuffer.java:358)
        at
org.apache.catalina.connector.CoyoteInputStream.read(CoyoteInputStream.j
ava:93)

It's strange to see the "invalid length" message at all IMO; I would
have expected only to see the "message is too big" error.

Is it possible to kind of merge these two errors together?

When this happens, what happens to the AJP connection? Assuming there
is a very large request coming-in and it takes e.g. 3 chunks of 64k
followed by a smaller chunk, will Tomcat throw an error for each of
the chunks, or will the connection be dropped and the request fail?

I'm actually having trouble reproducing this right now or I would have
simply tried it myself.

Thanks!
- -chris
-----BEGIN PGP SIGNATURE-----
Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/

iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAl7+NdkACgkQHPApP6U8
pFi6PhAAmP8mLKHjaDdCX9tRYDXOFDq/Y4qA/Y9lG2giMpI+/3SZU0DTS4SS4v8K
vgX/3E6bG2y8HDTZeNJu6GX/bYizLTnegp3bkZC+S8feTOHB92BoGDLFNjqkar6R
eCqPcWHjMSj1jUfGa1cLgVuvb97euPyQHKdiAq8eimu+jMT3EDcXuvuYztt/eFq/
/br7Kf60weArq19QKPVDakyzw5ONvjo046QKjpPMemLzS2DBIAJocjAXJzXEHwnv
wiD5eeSrFu83SDSXgEIjFi9TGXctAUhbgEJJV8GcSQc/t82VpGN+in8sOkPi7ZaT
JbXFSOFvYsCOwaCQPGpiD7oxozxp3i8i4W+x8UVnDiVK1UROTypk1CYEcorbBkgl
TJqZHPaFh3734C5F8RJNSk5juz/+eFTZJ/GxLo0Pp2NvCJsXLm/XdGSxZtGrW14j
K8LD1ylD7ULv28BI9iBzQ/PO2qahEVGb35hT7J7E9NJKA1lOdDJug69GSjDOkurw
M9MHNM0dyohsHN6X0KZoshmkToLBx1dBqfnvgjnKgc/RXmfRl0V+Xsa70kvNoGdd
RETgya5hFASD4FWkp+L4UCIqjH5GYxwGOyIKNBZveeOtQv+1KyxEzHqr8rI1aQXT
Q91qEZXtoofR+Agt5cODbqGj0n6m6KcmFW9bnpwt2+qLoRdL9p0=
=Lqqj
-----END PGP SIGNATURE-----

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

Reply via email to