mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-12-19 22:55:16 +01:00
It doesn't make sense for a proxy resolver to return NULL without an error on the first call. Whereas a DNS resolver would do this to indicate that a query completed successfully but found no results, a proxy resolver should return "direct://" instead. Therefore, if we are going to return NULL, we ought to have an error as well. Let's make sure this actually happens by adding some fallback errors just in case GProxyResolver feeds us weird results. Additionally, we should not return any errors except G_IO_ERROR_CANCELLED after the very first iteration. This is an API contract of GSocketAddressEnumerator. Let's add some checks to ensure this. Note that we have inadequate test coverage for GProxyAddressEnumerator. It's tested here only via GSocketClient. We could do a bit better by testing it directly as well. For example, I've added tests to see what happens when GProxyResolver returns both a valid and an invalid URI, but it's not so interesting here because GSocketClient always uses the valid result and ignores the error from GProxyAddressEnumerator. Fixes #2597
43 KiB
43 KiB