scottdraves / electricsheep

infinite evolving crowdsourced artwork
http://electricsheep.org
561 stars 70 forks source link

Download of sheep #59

Open roever opened 6 years ago

roever commented 6 years ago

Hi,

In the file Networking.cpp in line 242 there in a bug. The return value of select is checked for EINTR. When an error occures select will return -1 and then you have to check errno. As the code stands downloads will be interrupted for no reason when and EINTR even happens. This makes downloading sheep a game of chance and places an unnecessary load on the server

Instead of this

ifndef WIN32

        if ( err != EINTR )
        {
            return false;
        }

endif

the code should be

ifndef WIN32

        if ( errno != EINTR )
        {
            return false;
        }

endif

dasvo commented 6 years ago

Thanks roever,

I've incorporated this fix into the codebase. I'll close this issue when I am finished testing.