Re: [jetty-users] Jettu consumes request body with "Expect: 100-continue" header before "100 Continue" response is sent
I got the answer. HTTP specification doesn't force callee to wait for "100 Continue". So, HttpClient wait for 2 seconds (default settings, and I cannot override them since I cannot change client code) and then start pushing request body to the socket. This is clear.
So, currently my question is: how should POST request with "Expect: 100-continue" be handler in Jetty properly so that the client is not stuck even if it pushes data in blocking mode?
Two scenarios are possible:
1) Client has not send body yet. This case is clear - just set error code and flush the output.
2) Client is already sending the body - but what should I do in that case? On the one hand, I do not want to read request body. On the other hand, HttpClient got blocked until all data is written. I tried to play with Request.getHttpChannel(), Request.getHttpChannelState() and Request.getHttpInput(), but no success so far.
My current solution is to read the whole request body anyway, but this is definetly not the way to go.