if (errno != ECONNREFUSED)
ast_log(LOG_WARNING, "Error: %s\n", strerror(errno));
handle_error();
+ ASTOBJ_CONTAINER_LINK_END(&idlelist, thread);
return 1;
}
- if(test_losspct) { /* simulate random loss condition */
- if( (100.0*rand()/(RAND_MAX+1.0)) < test_losspct)
- return 1;
+ if (test_losspct && ((100.0*rand()/(RAND_MAX+1.0)) < test_losspct)) { /* simulate random loss condition */
+ ASTOBJ_CONTAINER_LINK_END(&idlelist, thread);
+ return 1;
}
/* Mark as ready and send on its way */
thread->iostate = IAX_IOSTATE_READY;