diff options
author | Benny Prijono <bennylp@teluu.com> | 2006-04-04 13:11:34 +0000 |
---|---|---|
committer | Benny Prijono <bennylp@teluu.com> | 2006-04-04 13:11:34 +0000 |
commit | 4b648642893d90cf1470a7cf4ad3c3cfab01f6b3 (patch) | |
tree | 80ecfc161b74079c991b837d744b9233afb91afc | |
parent | 9da5ebeca867322da5ed41e4e9fb3218caf5ab41 (diff) |
Removed some UDP socket warnings
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@377 74dad513-b988-da41-8d7b-12977e46ad98
-rw-r--r-- | pjsip/src/pjsip/sip_transport_udp.c | 27 |
1 files changed, 21 insertions, 6 deletions
diff --git a/pjsip/src/pjsip/sip_transport_udp.c b/pjsip/src/pjsip/sip_transport_udp.c index 19412f94..72acba11 100644 --- a/pjsip/src/pjsip/sip_transport_udp.c +++ b/pjsip/src/pjsip/sip_transport_udp.c @@ -26,6 +26,7 @@ #include <pj/os.h> #include <pj/pool.h> #include <pj/sock.h> +#include <pj/compat/socket.h> #include <pj/string.h> @@ -156,8 +157,14 @@ static void udp_on_read_complete( pj_ioqueue_key_t *key, rdata->pkt_info.len = 0; } else if (bytes_read == 0) { + /* TODO: */ - } else { + + } else if (-bytes_read != PJ_STATUS_FROM_OS(OSERR_EWOULDBLOCK) && + -bytes_read != PJ_STATUS_FROM_OS(OSERR_EINPROGRESS) && + -bytes_read != PJ_STATUS_FROM_OS(OSERR_ECONNRESET)) + { + /* Report error to endpoint. */ PJSIP_ENDPT_LOG_ERROR((rdata->tp_info.transport->endpt, rdata->tp_info.transport->obj_name, @@ -213,11 +220,19 @@ static void udp_on_read_complete( pj_ioqueue_key_t *key, } else { if (i < MAX_IMMEDIATE_PACKET) { - /* Report error to endpoint. */ - PJSIP_ENDPT_LOG_ERROR((rdata->tp_info.transport->endpt, - rdata->tp_info.transport->obj_name, - status, - "Warning: pj_ioqueue_recvfrom error")); + + /* Report error to endpoint if this is not EWOULDBLOCK error.*/ + if (status != PJ_STATUS_FROM_OS(OSERR_EWOULDBLOCK) && + status != PJ_STATUS_FROM_OS(OSERR_EINPROGRESS) && + status != PJ_STATUS_FROM_OS(OSERR_ECONNRESET)) + { + + PJSIP_ENDPT_LOG_ERROR((rdata->tp_info.transport->endpt, + rdata->tp_info.transport->obj_name, + status, + "Warning: pj_ioqueue_recvfrom")); + } + /* Continue loop. */ bytes_read = 0; } else { |