diff options
author | Daniel Stenberg <daniel@haxx.se> | 2020-05-02 16:59:38 +0200 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2020-05-03 22:48:04 +0200 |
commit | 59e351a572956fb99a1c1950b9b309cff5f16fc6 (patch) | |
tree | 3f55bd5b983c72ae7c9a52d7a001aa97b27cc8c2 /lib/asyn-thread.c | |
parent | f7ab488570ce67ab8cf6c0acf022fb8e1f55ad9b (diff) |
asyn-*: remove support for never-used NULL entry pointers
... and instead convert those to asserts to make sure they are truly
never NULL.
Closes #5324
Diffstat (limited to 'lib/asyn-thread.c')
-rw-r--r-- | lib/asyn-thread.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/asyn-thread.c b/lib/asyn-thread.c index 6f63ce833..2138eb5cf 100644 --- a/lib/asyn-thread.c +++ b/lib/asyn-thread.c @@ -509,6 +509,9 @@ static CURLcode resolver_error(struct connectdata *conn) return result; } +/* + * 'entry' may be NULL and then no data is returned + */ static CURLcode thread_wait_resolv(struct connectdata *conn, struct Curl_dns_entry **entry, bool report) @@ -593,8 +596,8 @@ CURLcode Curl_resolver_is_resolved(struct connectdata *conn, struct thread_data *td = (struct thread_data*) conn->async.os_specific; int done = 0; - if(entry) - *entry = NULL; + DEBUGASSERT(entry); + *entry = NULL; if(!td) { DEBUGASSERT(td); @@ -614,8 +617,7 @@ CURLcode Curl_resolver_is_resolved(struct connectdata *conn, return result; } destroy_async_data(&conn->async); - if(entry) - *entry = conn->async.dns; + *entry = conn->async.dns; } else { /* poll for name lookup done with exponential backoff up to 250ms */ |