mutability / dump1090

Dump1090 is a simple Mode S decoder for RTLSDR devices
528 stars 137 forks source link

Fix incorrect network I/O when buffer is larger than system buffer. #173

Closed tsunghanliu closed 7 years ago

tsunghanliu commented 7 years ago

When using the built-in webserver, I met an issue that some large files are not downloaded correctly. (e.g. ol3/ol-3.17.1.js) Because the socket is set to non-blocking mode and the system buffer can't be larger than /proc/sys/net/core/wmem_max. The errno will be EAGAIN or EWOULDBLOCK when this issue happens.

This PR tries to send/recv data again when getting this kind of errors.

mutability commented 7 years ago

This is an unfixable problem without a rewrite of the network layer. Spinning on write means that the (time-critical) sample processing is stalled and nothing progresses until the network client decides to accept the data. This is why the internal webserver is disabled. Just use an external webserver.