uvloop icon indicating copy to clipboard operation
uvloop copied to clipboard

Fix infinite loop bug

Open kfur opened this issue 4 years ago • 4 comments

Resolve #425

kfur avatar Oct 11 '21 13:10 kfur

To be honest, I don't understand why do we need while loop there? Anyway it will cause infinite loop if gettaddrinfo return ipv6 address while host doesn't have ipv6 interface

kfur avatar Oct 11 '21 15:10 kfur

Just as clueless, but perhaps it was intended for the for-loop (maybe it was even there before the while-loop was added)

jakirkham avatar Oct 21 '21 22:10 jakirkham

Thanks for the PR and comments!

The first commit was actually pretty clear:

https://github.com/MagicStack/uvloop/commit/2c61d5d3831676a04a33b117e77b782491cd6765#diff-a7cf5c98d355cbec45134d87daf36ebe5dea13c052e6098ca5331fedebfd6b8cR704-R712

So I think we should do:

        addrinfo = addrinfo.ai_next
        continue

rather than a single continue or break. I haven't verified or tested though.

fantix avatar Oct 22 '21 18:10 fantix

Yep, this work well

kfur avatar Oct 22 '21 21:10 kfur