Check fd for READ even too because generic tasks are called in loop
authorPekka Riikonen <priikone@silcnet.org>
Thu, 16 Jan 2003 17:45:14 +0000 (17:45 +0000)
committerPekka Riikonen <priikone@silcnet.org>
Thu, 16 Jan 2003 17:45:14 +0000 (17:45 +0000)
lib/silcutil/silcschedule.c

index ff47e29462f6e5bb49e428ba082a8d689d983a45..2a73c0da36c09b18b49d32cdf50bd2e6a4ae7047 100644 (file)
@@ -404,7 +404,8 @@ static void silc_schedule_dispatch_nontimeout(SilcSchedule schedule)
           in the callback function, ie. it is not valid anymore. */
 
        /* Is the task ready for reading */                             
-       if (task->valid && schedule->fd_list[i].revents & SILC_TASK_READ) {
+       if (task->valid && schedule->fd_list[i].revents & SILC_TASK_READ &&
+           fd == schedule->fd_list[i].fd) {
          silc_mutex_unlock(schedule->generic_queue->lock);
          SILC_SCHEDULE_UNLOCK(schedule);
          task->callback(schedule, schedule->app_context,