Improved http timeout logic
keepAliveTimeout should be low 10 seconds streamTineout should be high 300 seconds
They should be settable in App constructor
onData streaming should have timeout and should always end with isLast immediately if there is no data
It can also be measured in lowest allowed throughput like kbps limit
If these are passed in App constructor they will surely require an API break so v19
It is not really about whether these are configurable or not, it is about the current logic being sometimes problematic. There is a fix timeout of 10 seconds for every chunk which works in most cases but can be very problematic if chunks written to kernel are HUGE. Timeout should scale with number of bytes written to kernel, to keep timeouts sane in all cases.
On the writing side the problem is in favor of the server (slow receiving clients will get disconnected) because the kernel only emits writable events in large chunks.
On the reading side (posting a file to the server), the problem is in favor of the client - the client can send 1 single byte every 10 seconds and keep the connection open for as long as it wants. This can be a problem and here there needs to be a minimum number of bytes per 10 seconds that needs to be received.
I'm setting a default of 16kb/sec as lowest allowed receive throughput for now.