if (errno == EAGAIN || errno == EINTR) {
SILC_LOG_DEBUG(("Could not read immediately, will do it later"));
silc_schedule_set_listen_fd(sock->schedule, sock->sock,
+ silc_schedule_get_fd_events(sock->schedule,
+ sock->sock) |
SILC_TASK_READ, FALSE);
return -1;
}
if (errno == EAGAIN || errno == EINTR) {
SILC_LOG_DEBUG(("Could not read immediately, will do it later"));
silc_schedule_set_listen_fd(sock->schedule, sock->sock,
+ silc_schedule_get_fd_events(sock->schedule,
+ sock->sock) |
SILC_TASK_READ, FALSE);
return -1;
}
/* If we have passed the rate time limit, set our new time limit,
and zero the rate limit. This limits reads per second. */
silc_gettimeofday(&curtime);
- if (!silc_compare_timeval(&curtime, &sock->qos->next_limit)) {
+ if (silc_compare_timeval(&curtime, &sock->qos->next_limit) > 0) {
curtime.tv_sec++;
sock->qos->next_limit = curtime;
sock->qos->cur_rate = 0;
memcpy(error, err, strlen(err));
return TRUE;
}
-#endif /* 0 */
+#endif
/* Closes socket */