On Thu, Nov 20, 2014 at 12:29 PM, Sebastian Lackner sebastian@fds-team.de wrote:
Just in addition to my previous msg - bug 8606 could also be easily fixed by just dividing the returned value by 2 if you're using a linux system. This "feature" of allocating twice the requested buffer is officially documented and unlikely to change in the near future: http://man7.org/linux/man-pages/man7/socket.7.html If we want to be completely on the save side we could also detect it at runtime on ws2_32 initialization.
That's why storing the value in the server and using min(memory_stored_value, getsockopt_value) would solve this issue. Dividing by 2 would require the introduction of #ifdef.