wget-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

wget2 | dns: Return all kinds of socket types available (!528)


From: Ander Juaristi (@juaristi)
Subject: wget2 | dns: Return all kinds of socket types available (!528)
Date: Sun, 20 Aug 2023 11:41:41 +0000


Ander Juaristi created a merge request: 
https://gitlab.com/gnuwget/wget2/-/merge_requests/528

Branches: aj-dns-socktype to master
Author:   Ander Juaristi




The `resolve()` function would always return `SOCK_STREAM`-type sockets, TCP 
sockets.

I propose to change this function such that it will return all the socket types 
that the system supports (by removing the `.ai_socktype = SOCK_STREAM` hint),
and then let the consumer decide which socket type they want to use.

My biggest concern is that `wget_dns_resolve` is a public API function and we 
are changing its behavior here. Although we never documented
this function will always return TCP sockets, folks out there might have relied 
on that behavior. I have observed my `getaddrinfo()` always puts the 
`SOCK_STREAM` sockets first on the returned `addrinfo` list,
but I don't know if this is intentional or not.

Another possibility would be to maintain the current `wget_dns_resolve` 
behavior (always returning TCP sockets), and create a new function (let's say 
`wget_dns_resolve2`) that lets the caller decide which socket type they want.

In addition, I'm introducing other subtle changes such as moving TCP connect 
code to its own function to declutter some of the code.


### Approver's checklist:

* [ ] The author has submitted the FSF Copyright Assignment and is listed in 
AUTHORS
* [ ] There is a test suite reasonably covering new functionality or 
modifications
* [ ] Function naming, parameters, return values, types, etc., are consistent 
with existing code
* [ ] This feature/change has adequate documentation added (if appropriate)
* [ ] No obvious mistakes / misspelling in the code

-- 
Reply to this email directly or view it on GitLab: 
https://gitlab.com/gnuwget/wget2/-/merge_requests/528
You're receiving this email because of your account on gitlab.com.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]