commit af6907bf376ad1ee642b1a281ef64cdb7cd4ddbe from: Omar Polo date: Tue Feb 13 13:56:10 2024 UTC net: improve handling of connect(2) failures If we succeed to make a socket(2) but fail to connect(2), still attempt to reconnect using the other results from getaddrinfo(3). commit - d58e30183b960da17519b4f825f9c8a1fb4cdf41 commit + af6907bf376ad1ee642b1a281ef64cdb7cd4ddbe blob - 665be5e2551e10f12c9fe469c44c8b0b4186811a blob + fc0063ef939ff6c0dc27399e2ce8666603b03362 --- net.c +++ net.c @@ -153,7 +153,10 @@ again: goto err; if (error != 0) { errno = error; - goto err; + close(req->fd); + req->fd = -1; + req->p = req->p->ai_next; + goto again; } goto done; }