From: Pekka Riikonen Date: Tue, 24 Jul 2001 09:47:53 +0000 (+0000) Subject: updates. X-Git-Tag: robodoc-323~35 X-Git-Url: http://git.silcnet.org/gitweb/?p=silc.git;a=commitdiff_plain;h=440c3ddf91b2828e6ba768f797a371f56047b30d updates. --- diff --git a/lib/silcutil/silcschedule.c b/lib/silcutil/silcschedule.c index 1d727c6b..d3833af1 100644 --- a/lib/silcutil/silcschedule.c +++ b/lib/silcutil/silcschedule.c @@ -269,14 +269,17 @@ static void silc_schedule_dispatch_nontimeout(SilcSchedule schedule) { SilcTask task; int i, last_fd = schedule->last_fd; + uint32 fd; for (i = 0; i <= last_fd; i++) { if (schedule->fd_list[i].events == 0) continue; + fd = schedule->fd_list[i].fd; + /* First check whether this fd has task in the fd queue */ silc_mutex_lock(schedule->fd_queue->lock); - task = silc_task_find(schedule->fd_queue, schedule->fd_list[i].fd); + task = silc_task_find(schedule->fd_queue, fd); /* If the task was found then execute its callbacks. If not then execute all generic tasks for that fd. */ @@ -328,8 +331,7 @@ static void silc_schedule_dispatch_nontimeout(SilcSchedule schedule) if (task->valid && schedule->fd_list[i].revents & SILC_TASK_READ) { silc_mutex_unlock(schedule->generic_queue->lock); silc_mutex_unlock(schedule->lock); - task->callback(schedule, SILC_TASK_READ, schedule->fd_list[i].fd, - task->context); + task->callback(schedule, SILC_TASK_READ, fd, task->context); silc_mutex_lock(schedule->lock); silc_mutex_lock(schedule->generic_queue->lock); } @@ -338,8 +340,7 @@ static void silc_schedule_dispatch_nontimeout(SilcSchedule schedule) if (task->valid && schedule->fd_list[i].revents & SILC_TASK_WRITE) { silc_mutex_unlock(schedule->generic_queue->lock); silc_mutex_unlock(schedule->lock); - task->callback(schedule, SILC_TASK_WRITE, schedule->fd_list[i].fd, - task->context); + task->callback(schedule, SILC_TASK_WRITE, fd, task->context); silc_mutex_lock(schedule->lock); silc_mutex_lock(schedule->generic_queue->lock); }