socket_strerror() sometimes maps errno, instead of its argument
Looks like a historical bug. Its err argument is an error number, but if it isn't using a custom error message for it, it just calls strerror() with the errno global, effectively ignoring its argument and returning a semi-random string.
This commit is contained in:
parent
db47a91d40
commit
27a3964ff7
@ -418,8 +418,8 @@ const char *socket_strerror(int err) {
|
|||||||
case ECONNREFUSED: return "connection refused";
|
case ECONNREFUSED: return "connection refused";
|
||||||
case ECONNABORTED: return "closed";
|
case ECONNABORTED: return "closed";
|
||||||
case ECONNRESET: return "closed";
|
case ECONNRESET: return "closed";
|
||||||
case ETIMEDOUT: return "timedout";
|
case ETIMEDOUT: return "timeout";
|
||||||
default: return strerror(errno);
|
default: return strerror(err);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user