Skip to content

Commit a6b9959

Browse files
authored
[core] Fixed misleading error message for listening socket (#3102).
1 parent 8a89a3a commit a6b9959

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

scripts/generate-error-types.tcl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -109,17 +109,17 @@ set errortypes {
109109
NOTSUP "Operation not supported" {
110110
NONE ""
111111
ISBOUND "Cannot do this operation on a BOUND socket"
112-
ISCONNECTED "Cannot do this operation on a CONNECTED socket"
112+
ISCONNECTED "Cannot do this operation on a CONNECTED or LISTENING socket"
113113
INVAL "Bad parameters"
114114
SIDINVAL "Invalid socket ID"
115115
ISUNBOUND "Cannot do this operation on an UNBOUND socket"
116116
NOLISTEN "Socket is not in listening state"
117117
ISRENDEZVOUS "Listen/accept is not supported in rendezvous connection setup"
118118
ISRENDUNBOUND "Cannot call connect on UNBOUND socket in rendezvous connection setup"
119-
INVALMSGAPI "Incorrect use of Message API (sendmsg/recvmsg)."
120-
INVALBUFFERAPI "Incorrect use of Buffer API (send/recv) or File API (sendfile/recvfile)."
119+
INVALMSGAPI "Incorrect use of Message API (sendmsg/recvmsg)"
120+
INVALBUFFERAPI "Incorrect use of Buffer API (send/recv) or File API (sendfile/recvfile)"
121121
BUSY "Another socket is already listening on the same port"
122-
XSIZE "Message is too large to send (it must be less than the SRT send buffer size)"
122+
XSIZE "Message too large to send (exceeds send buffer size)"
123123
EIDINVAL "Invalid epoll ID"
124124
EEMPTY "All sockets removed from epoll, waiting would deadlock"
125125
BUSYPORT "Another socket is bound to that port and is not reusable for requested settings"
@@ -169,7 +169,7 @@ const char* strerror_get_message(size_t major, size_t minor)
169169
}
170170

171171
const char** array = strerror_array_major[major];
172-
size_t size = strerror_array_sizes[major];
172+
const size_t size = strerror_array_sizes[major];
173173

174174
if (minor >= size)
175175
{

srtcore/strerror_defs.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ const char* strerror_msgs_filesystem [] = {
6666
const char* strerror_msgs_notsup [] = {
6767
"Operation not supported", // MN_NONE = 0
6868
"Operation not supported: Cannot do this operation on a BOUND socket", // MN_ISBOUND = 1
69-
"Operation not supported: Cannot do this operation on a CONNECTED socket", // MN_ISCONNECTED = 2
69+
"Operation not supported: Cannot do this operation on a CONNECTED or LISTENING socket", // MN_ISCONNECTED = 2
7070
"Operation not supported: Bad parameters", // MN_INVAL = 3
7171
"Operation not supported: Invalid socket ID", // MN_SIDINVAL = 4
7272
"Operation not supported: Cannot do this operation on an UNBOUND socket", // MN_ISUNBOUND = 5
@@ -76,7 +76,7 @@ const char* strerror_msgs_notsup [] = {
7676
"Operation not supported: Incorrect use of Message API (sendmsg/recvmsg)", // MN_INVALMSGAPI = 9
7777
"Operation not supported: Incorrect use of Buffer API (send/recv) or File API (sendfile/recvfile)", // MN_INVALBUFFERAPI = 10
7878
"Operation not supported: Another socket is already listening on the same port", // MN_BUSY = 11
79-
"Operation not supported: Message is too large to send", // MN_XSIZE = 12
79+
"Operation not supported: Message too large to send (exceeds send buffer size)", // MN_XSIZE = 12
8080
"Operation not supported: Invalid epoll ID", // MN_EIDINVAL = 13
8181
"Operation not supported: All sockets removed from epoll, waiting would deadlock", // MN_EEMPTY = 14
8282
"Operation not supported: Another socket is bound to that port and is not reusable for requested settings", // MN_BUSYPORT = 15

0 commit comments

Comments
 (0)