f20eba426a
Here we add special handling for sending an error response when the write timeout of the HTTP server is just about to expire. This is surprisingly difficult to get right, since is must be ensured that all output is fully flushed in time, which needs support from multiple levels of the RPC handler stack: The timeout response can't use chunked transfer-encoding because there is no way to write the final terminating chunk. net/http writes it when the topmost handler returns, but the timeout will already be over by the time that happens. We decided to disable chunked encoding by setting content-length explicitly. Gzip compression must also be disabled for timeout responses because we don't know the true content-length before compressing all output, i.e. compression would reintroduce chunked transfer-encoding. |
||
---|---|---|
.. | ||
api_test.go | ||
api.go | ||
config_test.go | ||
config.go | ||
defaults.go | ||
doc.go | ||
endpoints.go | ||
errors.go | ||
jwt_auth.go | ||
jwt_handler.go | ||
lifecycle.go | ||
node_auth_test.go | ||
node_example_test.go | ||
node_test.go | ||
node.go | ||
rpcstack_test.go | ||
rpcstack.go | ||
utils_test.go |