[GitHub] [apr] uhliarik commented on pull request #44: Fix socket creation when APR_UNSPEC is used

uhliarik (via GitHub) <[email protected]>
Newsgroups gmane.comp.apache.apr.devel
Message-ID <PR_kwDOAAJ05c5Tye6z-98957ba2-1bd9-496b-bad5-eb2ff6bf6be0@gitbox.apache.org>
uhliarik commented on PR #44:
URL: https://github.com/apache/apr/pull/44#issuecomment-1607292016

   > Ah, hmm. I think this is still incorrect. The proper way is to loop over the returned addresses until a connect() succeeds. e.g. this:
   > 
   > https://github.com/apache/httpd/blob/66254273e22a5b4051d15d7423b86a5d884b4ee5/modules/ssl/ssl_util_ocsp.c#L105
   
   Ohh, I thought this job is done in apr_sockaddr_info_get  --> find_addresses --> call_resolver():
   
   https://github.com/apache/apr/blob/trunk/network_io/unix/sockaddr.c#L446
   
   But this will only go through the list of addresses until the first AF_INET/AF_INET6 address is found. In case we pass hostname to it, it will indeed try only the first returned address which is not correct approach. I will to alter this patch and add the part where it will loop through all returned addresses until a connect() succeeds.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.