Am 2020-05-27 um 12:35 schrieb Mark Thomas: > This then opens up an interesting question of whether to bother reading > *any* of the request body if Tomcat knows it is going to close the > connection before reading all of it. Based on what you have observed, > would earlier closure of the connection (after a response with a > "Connection: close" header) create additional difficulties? Would those > clients that currently read the response while Tomcat is swallowing the > first 2MB of upload still read the response if Tomcat didn't swallow any > of the request? I think you can test this with maxSwallowSize="0"
As requested, reconfigured to 0 plain HTTP and HTTPS. For clients which can handle early responses at anytime, e.g. curl, it does not matter. They will stop sending as soon as possible. So does curl here.
For clients which do not handle this, they will fail earlier, but not as soon as possible because they will send until the socket is broken and a SocketException is raised. They don't see the early response at all. If and only if the entire body is swallowed the final response is seen. Personally, I prefer to fail fast.
I see no silver bullet here. It seriously depends on the usecase. If the usecase contains a slow link between client and server, I prefer 0. For a fast link, it depends on the average size of the request payload.
Can provide output for both, if required. Michael --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org