Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix handling for spurious msgs and protocol errors
This fix prevents us from sending back a 400 error in response to unexpected messages that may come in. The intent in the original catch-all clause seems to be to match on TCP or SSL errors, but if we get some other unexpected message coming in from the application layer, then that will also trigger the catch-all. This can have especially bad consequences if keepalives are enabled, as we may end up sending both a valid response AND a 400 on the same connection for a single request. At the same time, not all TCP/SSL errors necessarily warrant a 400 response, so most errors will now simply trigger us to close the socket. The exception is emsgsize errors, since this typically comes from the packet decoder, suggesting that there is indeed actually a problem with the client request itself. This is also the only such case that is explicitly tested in the eunit test code, so that behavior is maintained with no need to fix any tests.
- Loading branch information