/[svn]/ircd-hybrid/trunk/src/s_bsd_select.c
ViewVC logotype

Diff of /ircd-hybrid/trunk/src/s_bsd_select.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2649 by michael, Fri Dec 6 19:39:55 2013 UTC revision 2650 by michael, Tue Dec 10 19:46:48 2013 UTC
# Line 81  comm_setselect(fde_t *F, unsigned int ty Line 81  comm_setselect(fde_t *F, unsigned int ty
81    }    }
82    
83    new_events = (F->read_handler ? COMM_SELECT_READ : 0) |    new_events = (F->read_handler ? COMM_SELECT_READ : 0) |
84      (F->write_handler ? COMM_SELECT_WRITE : 0);                 (F->write_handler ? COMM_SELECT_WRITE : 0);
85    
86    if (timeout != 0)    if (timeout != 0)
87      F->timeout = CurrentTime + (timeout / 1000);      F->timeout = CurrentTime + (timeout / 1000);
# Line 108  comm_setselect(fde_t *F, unsigned int ty Line 108  comm_setselect(fde_t *F, unsigned int ty
108      {      {
109        if (highest_fd == F->fd)        if (highest_fd == F->fd)
110          while (highest_fd >= 0 && (FD_ISSET(highest_fd, &select_readfds) ||          while (highest_fd >= 0 && (FD_ISSET(highest_fd, &select_readfds) ||
111                                     FD_ISSET(highest_fd, &select_writefds)))                                     FD_ISSET(highest_fd, &select_writefds)))
112            highest_fd--;            highest_fd--;
113      }      }
114      else if (F->evcache == 0)      else if (F->evcache == 0)
# Line 154  comm_select(void) Line 154  comm_select(void)
154    }    }
155    
156    for (fd = 0; fd <= highest_fd && num > 0; fd++)    for (fd = 0; fd <= highest_fd && num > 0; fd++)
157      {
158      if (FD_ISSET(fd, &tmpreadfds) || FD_ISSET(fd, &tmpwritefds))      if (FD_ISSET(fd, &tmpreadfds) || FD_ISSET(fd, &tmpwritefds))
159      {      {
160        num--;        num--;
# Line 163  comm_select(void) Line 164  comm_select(void)
164          continue;          continue;
165    
166        if (FD_ISSET(fd, &tmpreadfds))        if (FD_ISSET(fd, &tmpreadfds))
167          {
168          if ((hdl = F->read_handler) != NULL)          if ((hdl = F->read_handler) != NULL)
169          {          {
170            F->read_handler = NULL;            F->read_handler = NULL;
# Line 170  comm_select(void) Line 172  comm_select(void)
172            if (!F->flags.open)            if (!F->flags.open)
173              continue;              continue;
174          }          }
175          }
176    
177        if (FD_ISSET(fd, &tmpwritefds))        if (FD_ISSET(fd, &tmpwritefds))
178          {
179          if ((hdl = F->write_handler) != NULL)          if ((hdl = F->write_handler) != NULL)
180          {          {
181            F->write_handler = NULL;            F->write_handler = NULL;
# Line 179  comm_select(void) Line 183  comm_select(void)
183            if (!F->flags.open)            if (!F->flags.open)
184              continue;              continue;
185          }          }
186          }
187    
188        comm_setselect(F, 0, NULL, NULL, 0);        comm_setselect(F, 0, NULL, NULL, 0);
189      }      }
190      }
191  }  }
192  #endif  #endif

Legend:
Removed from v.2649  
changed lines
  Added in v.2650

svnadmin@ircd-hybrid.org
ViewVC Help
Powered by ViewVC 1.1.28