/[radius]/radius/radiusd/input.c
ViewVC logotype

Diff of /radius/radiusd/input.c

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

revision 1.4 by gray, Wed Apr 30 20:12:25 2003 UTC revision 1.5 by gray, Sat May 3 10:33:22 2003 UTC
# Line 22  Line 22 
22  #include <errno.h>  #include <errno.h>
23  #include <radiusd.h>  #include <radiusd.h>
24  #include <list.h>  #include <list.h>
25    #include <assert.h>
26    
27  struct input_system {  struct input_system {
28          LIST *methods;    /* List of METHOD structures */          LIST *methods;    /* List of METHOD structures */
# Line 114  channel_close(CHANNEL *chan) Line 115  channel_close(CHANNEL *chan)
115                  chan->method->close(chan->fd, chan->data);                  chan->method->close(chan->fd, chan->data);
116          FD_CLR(chan->fd, &chan->method->fdset);          FD_CLR(chan->fd, &chan->method->fdset);
117          chan->method->fd_max = -2;          chan->method->fd_max = -2;
118            efree(chan);
119  }  }
120    
121  static int  static int
# Line 157  input_close_channels(INPUT *input) Line 159  input_close_channels(INPUT *input)
159               p = iterator_next(input->citr)) {               p = iterator_next(input->citr)) {
160                  list_remove(input->channels, p, NULL);                  list_remove(input->channels, p, NULL);
161                  channel_close(p);                  channel_close(p);
                 efree(p);  
162          }          }
163          iterator_destroy(&input->citr);          iterator_destroy(&input->citr);
164  }  }
# Line 197  input_close_channel_data(INPUT *input, c Line 198  input_close_channel_data(INPUT *input, c
198          if (p) {          if (p) {
199                  list_remove(input->channels, p, NULL);                  list_remove(input->channels, p, NULL);
200                  channel_close(p);                  channel_close(p);
                 efree(p);  
201          }          }
202  }  }
203    
# Line 206  input_select(INPUT *input, struct timeva Line 206  input_select(INPUT *input, struct timeva
206  {  {
207          METHOD *m;          METHOD *m;
208          int status;          int status;
209            int count = 0;
210            
211          if (!input->citr)          if (!input->citr)
212                  input->citr = iterator_create(input->channels);                  input->citr = iterator_create(input->channels);
213          if (!input->mitr)          if (!input->mitr)
# Line 230  input_select(INPUT *input, struct timeva Line 231  input_select(INPUT *input, struct timeva
231                  if (m->fd_max < 0)                  if (m->fd_max < 0)
232                          continue;                          continue;
233                                    
234                    count++;
235                    
236                  readfds = m->fdset;                  readfds = m->fdset;
237                                    
238                  status = select(m->fd_max + 1, &readfds, NULL, NULL, tv);                  status = select(m->fd_max + 1, &readfds, NULL, NULL, tv);
# Line 245  input_select(INPUT *input, struct timeva Line 248  input_select(INPUT *input, struct timeva
248                          }                          }
249                  }                  }
250          }          }
251            assert(count > 0);
252            
253          return status;          return status;
254  }  }

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.5

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26