mirror of
https://github.com/freebsd/freebsd-src.git
synced 2026-10-28 19:34:43 +01:00
libfetch: Fix handling of connection failures
After commit848f360c8f, if one tries to connect to a closed port, fetch reports "Operation now in progress", which is rather confusing. Return a more useful error message, restoring the old behaviour. Fixes:848f360c8f("libfetch: Apply timeout to connection attempts") Reviewed by: des MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D58481
This commit is contained in:
1 parent
d93d235291
commit
b02e02958d
1 file changed
+4
@@ -681,6 +681,10 @@ fetch_connect(const char *host, int port, int af, int verbose)
|
||||
delta.tv_usec / 1000;
|
||||
}
|
||||
}
|
||||
if (pfd.revents & POLLHUP) {
|
||||
errno = ECONNREFUSED;
|
||||
break;
|
||||
}
|
||||
if (pfd.revents == POLLOUT) {
|
||||
/* connection established */
|
||||
err = 0;
|
||||
|
||||
Reference in new issue
Block a user