Changeset 5668
- Timestamp:
- Sep 29, 2017 2:43:05 AM (7 years ago)
- Location:
- pjproject/trunk/pjsip
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip/include/pjsip/sip_config.h
r5557 r5668 377 377 #endif 378 378 379 /** 380 * Specify if #pjsip_endpt_handle_events() should sleep if ioqueue poll 381 * returns error. 382 * 383 * Default is 1 (yes). 384 */ 385 386 #ifndef PJSIP_HANDLE_EVENTS_HAS_SLEEP_ON_ERR 387 # define PJSIP_HANDLE_EVENTS_HAS_SLEEP_ON_ERR 1 388 #endif 379 389 380 390 /** -
pjproject/trunk/pjsip/src/pjsip/sip_endpoint.c
r5397 r5668 35 35 #include <pj/errno.h> 36 36 #include <pj/lock.h> 37 #include <pj/math.h> 37 38 38 39 #define PJSIP_EX_NO_MEMORY pj_NO_MEMORY_EXCEPTION() … … 700 701 unsigned *p_count) 701 702 { 703 enum { MAX_TIMEOUT_ON_ERR = 10 }; 702 704 /* timeout is 'out' var. This just to make compiler happy. */ 703 705 pj_time_val timeout = { 0, 0}; … … 743 745 if (c < 0) { 744 746 pj_status_t err = pj_get_netos_error(); 745 pj_thread_sleep(PJ_TIME_VAL_MSEC(timeout)); 747 #if PJSIP_HANDLE_EVENTS_HAS_SLEEP_ON_ERR 748 unsigned msec = PJ_TIME_VAL_MSEC(timeout); 749 pj_thread_sleep(PJ_MIN(msec, MAX_TIMEOUT_ON_ERR)); 750 #endif 751 746 752 if (p_count) 747 753 *p_count = count;
Note: See TracChangeset
for help on using the changeset viewer.