Robert Pluim writes: > OK, that does make sense, and might even be more correct, but itʼs a > bigger change. You'll need more than just me to agree with it. > Patch reworked: * before the select, check every interesting gnutls stream for available data in the buffer * if some of them hit, and either there is no wait_proc or the wait_proc is one of the gnutls streams with new data, set the select timeout to 0 * after the select, merge the gnutls buffer status into the select returns The patch is not much longer than before, still a net reduction of code lines. I've done some light testing and haven't found any problem.