diff options
Diffstat (limited to 'pjlib/src/pjlib-test/ioq_tcp.c')
-rw-r--r-- | pjlib/src/pjlib-test/ioq_tcp.c | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/pjlib/src/pjlib-test/ioq_tcp.c b/pjlib/src/pjlib-test/ioq_tcp.c index 8f2d74d0..7f004d9f 100644 --- a/pjlib/src/pjlib-test/ioq_tcp.c +++ b/pjlib/src/pjlib-test/ioq_tcp.c @@ -82,11 +82,22 @@ static void on_ioqueue_accept(pj_ioqueue_key_t *key, pj_sock_t sock, int status) { - PJ_UNUSED_ARG(sock); - - callback_accept_key = key; - callback_accept_op = op_key; - callback_accept_status = status; + if (sock == PJ_INVALID_SOCKET) { + + if (status != PJ_SUCCESS) { + /* Ignore. Could be blocking error */ + app_perror(".....warning: received error in on_ioqueue_accept() callback", + status); + } else { + callback_accept_status = -61; + PJ_LOG(3,("", "..... on_ioqueue_accept() callback was given " + "invalid socket and status is %d", status)); + } + } else { + callback_accept_key = key; + callback_accept_op = op_key; + callback_accept_status = status; + } } static void on_ioqueue_connect(pj_ioqueue_key_t *key, int status) |