mirror of
https://github.com/lunarmodules/luasocket.git
synced 2024-11-08 14:28:21 +01:00
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 ECONNABORTED: return "closed";
|
||||
case ECONNRESET: return "closed";
|
||||
case ETIMEDOUT: return "timedout";
|
||||
default: return strerror(errno);
|
||||
case ETIMEDOUT: return "timeout";
|
||||
default: return strerror(err);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user