peer: fix compare of hostname for uds
No binary (build failed)
—
(log yok)
| @@ -318,15 +318,24 @@ bool Curl_peer_equal(struct Curl_peer *p1, struct Curl_peer *p2) | |
| Curl_peer_same_destination(p1, p2)); | |
| } | |
| + | static bool peer_same_hostname(struct Curl_peer *p1, struct Curl_peer *p2) |
| + | { |
| + | /* UNIX domain socket paths must be compared case-sensitive, |
| + | * as many filesystem are like that. */ |
| + | return (p1->unix_socket == p2->unix_socket) && |
| + | (p1->abstract_uds == p2->abstract_uds) && |
| + | (p1->ipv6 == p2->ipv6) && |
| + | (p1->unix_socket ? |
| + | !strcmp(p1->hostname, p2->hostname) : |
| + | curl_strequal(p1->hostname, p2->hostname)); |
| + | } |
| + | |
| bool Curl_peer_same_destination(struct Curl_peer *p1, struct Curl_peer *p2) | |
| { | |
| return (p1 == p2) || | |
| (p1 && p2 && | |
| (p1->port == p2->port) && | |
| - | curl_strequal(p1->hostname, p2->hostname) && |
| - | (p1->ipv6 == p2->ipv6) && |
| - | (p1->unix_socket == p2->unix_socket) && |
| - | (p1->abstract_uds == p2->abstract_uds) && |
| + | peer_same_hostname(p1, p2) && |
| (p1->scopeid == p2->scopeid) && | |
| (p1->scopeid || curl_strequal(p1->zoneid, p2->zoneid))); | |
| } | |