← Commit list

35b0490aab

Stefan Eissing
Stefan Eissing
2026-09-15
SUCCESS Duration: 426s

Subject

peer: speed up "same destination" check

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

lib/peer.c+6 -3
@@ -333,9 +333,12 @@ static bool peer_same_hostname(struct Curl_peer *p1, struct Curl_peer *p2)
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));
+ /* unix_socket paths are case-sensitive, hostnames are not.
+ * Do strcmp() first on both, since we do a lot of matches
+ * on the same names and platform strcmp is way faster. */
+ (!strcmp(p1->hostname, p2->hostname) ||
+ (!p1->unix_socket &&
+ curl_strequal(p1->hostname, p2->hostname)));
}
bool Curl_peer_same_destination(struct Curl_peer *p1, struct Curl_peer *p2)
lib/url.c+6 -4
@@ -690,14 +690,16 @@ static bool url_match_multiplex_limits(struct connectdata *conn,
/* If multiplexed, make sure we do not go over concurrency limit */
if(conn->attached_xfers >=
Curl_multi_max_concurrent_streams(m->data->multi)) {
- infof(m->data, "client side MAX_CONCURRENT_STREAMS reached"
- ", skip (%u)", conn->attached_xfers);
+ infof(m->data, "connection #%" FMT_OFF_T " reached "
+ "MAX_CONCURRENT_STREAMS(%u), skip",
+ conn->connection_id, conn->attached_xfers);
return FALSE;
}
if(conn->attached_xfers >=
Curl_conn_get_max_concurrent(m->data, conn, FIRSTSOCKET)) {
- infof(m->data, "MAX_CONCURRENT_STREAMS reached, skip (%u)",
- conn->attached_xfers);
+ infof(m->data, "connection #%" FMT_OFF_T "reached "
+ "MAX_CONCURRENT_STREAMS(%u), skip",
+ conn->connection_id, conn->attached_xfers);
return FALSE;
}
/* When not multiplexed, we have a match here! */