Skip to content

Commit

Permalink
[core] Fixed misleading error message for listening socket (#3102).
Browse files Browse the repository at this point in the history
  • Loading branch information
ethouris authored Jan 20, 2025
1 parent 8a89a3a commit a6b9959
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions scripts/generate-error-types.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -109,17 +109,17 @@ set errortypes {
NOTSUP "Operation not supported" {
NONE ""
ISBOUND "Cannot do this operation on a BOUND socket"
ISCONNECTED "Cannot do this operation on a CONNECTED socket"
ISCONNECTED "Cannot do this operation on a CONNECTED or LISTENING socket"
INVAL "Bad parameters"
SIDINVAL "Invalid socket ID"
ISUNBOUND "Cannot do this operation on an UNBOUND socket"
NOLISTEN "Socket is not in listening state"
ISRENDEZVOUS "Listen/accept is not supported in rendezvous connection setup"
ISRENDUNBOUND "Cannot call connect on UNBOUND socket in rendezvous connection setup"
INVALMSGAPI "Incorrect use of Message API (sendmsg/recvmsg)."
INVALBUFFERAPI "Incorrect use of Buffer API (send/recv) or File API (sendfile/recvfile)."
INVALMSGAPI "Incorrect use of Message API (sendmsg/recvmsg)"
INVALBUFFERAPI "Incorrect use of Buffer API (send/recv) or File API (sendfile/recvfile)"
BUSY "Another socket is already listening on the same port"
XSIZE "Message is too large to send (it must be less than the SRT send buffer size)"
XSIZE "Message too large to send (exceeds send buffer size)"
EIDINVAL "Invalid epoll ID"
EEMPTY "All sockets removed from epoll, waiting would deadlock"
BUSYPORT "Another socket is bound to that port and is not reusable for requested settings"
Expand Down Expand Up @@ -169,7 +169,7 @@ const char* strerror_get_message(size_t major, size_t minor)
}

const char** array = strerror_array_major[major];
size_t size = strerror_array_sizes[major];
const size_t size = strerror_array_sizes[major];

if (minor >= size)
{
Expand Down
4 changes: 2 additions & 2 deletions srtcore/strerror_defs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ const char* strerror_msgs_filesystem [] = {
const char* strerror_msgs_notsup [] = {
"Operation not supported", // MN_NONE = 0
"Operation not supported: Cannot do this operation on a BOUND socket", // MN_ISBOUND = 1
"Operation not supported: Cannot do this operation on a CONNECTED socket", // MN_ISCONNECTED = 2
"Operation not supported: Cannot do this operation on a CONNECTED or LISTENING socket", // MN_ISCONNECTED = 2
"Operation not supported: Bad parameters", // MN_INVAL = 3
"Operation not supported: Invalid socket ID", // MN_SIDINVAL = 4
"Operation not supported: Cannot do this operation on an UNBOUND socket", // MN_ISUNBOUND = 5
Expand All @@ -76,7 +76,7 @@ const char* strerror_msgs_notsup [] = {
"Operation not supported: Incorrect use of Message API (sendmsg/recvmsg)", // MN_INVALMSGAPI = 9
"Operation not supported: Incorrect use of Buffer API (send/recv) or File API (sendfile/recvfile)", // MN_INVALBUFFERAPI = 10
"Operation not supported: Another socket is already listening on the same port", // MN_BUSY = 11
"Operation not supported: Message is too large to send", // MN_XSIZE = 12
"Operation not supported: Message too large to send (exceeds send buffer size)", // MN_XSIZE = 12
"Operation not supported: Invalid epoll ID", // MN_EIDINVAL = 13
"Operation not supported: All sockets removed from epoll, waiting would deadlock", // MN_EEMPTY = 14
"Operation not supported: Another socket is bound to that port and is not reusable for requested settings", // MN_BUSYPORT = 15
Expand Down

0 comments on commit a6b9959

Please sign in to comment.