forked from cerc-io/plugeth
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. |
||
---|---|---|
.. | ||
discover | ||
dnsdisc | ||
enode | ||
enr | ||
msgrate | ||
nat | ||
netutil | ||
nodestate | ||
rlpx | ||
simulations | ||
tracker | ||
dial_test.go | ||
dial.go | ||
message_test.go | ||
message.go | ||
metrics.go | ||
peer_error.go | ||
peer_test.go | ||
peer.go | ||
protocol.go | ||
server_test.go | ||
server.go | ||
transport_test.go | ||
transport.go | ||
util_test.go | ||
util.go |