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

Diff of /radius/radiusd/rpp.c

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

revision 1.7 by gray, Thu May 29 09:30:25 2003 UTC revision 1.8 by gray, Tue Jun 3 14:22:57 2003 UTC
# Line 17  Line 17 
17    
18  /* RPP is a Radius Process Pool */  /* RPP is a Radius Process Pool */
19    
20    #define RADIUS_MODULE_RPP_C
21    
22  #ifdef HAVE_CONFIG_H  #ifdef HAVE_CONFIG_H
23  # include <config.h>  # include <config.h>
24  #endif  #endif
# Line 166  rpp_lookup_ready(int (*proc_main)(void * Line 168  rpp_lookup_ready(int (*proc_main)(void *
168                  if (rpp_start_process(&proc, proc_main, data))                  if (rpp_start_process(&proc, proc_main, data))
169                          return NULL;                          return NULL;
170                  radiusd_register_input_fd("rpp", proc.p[0], NULL);                  radiusd_register_input_fd("rpp", proc.p[0], NULL);
171                  p = mem_alloc(sizeof(*p));                  p = emalloc(sizeof(*p));
172                  *p = proc;                  *p = proc;
173                  list_append(process_list, p);                  list_append(process_list, p);
174          }          }
# Line 193  _rpp_remove(rpp_proc_t *p) Line 195  _rpp_remove(rpp_proc_t *p)
195          close(p->p[1]);          close(p->p[1]);
196          radiusd_close_channel(p->p[0]);          radiusd_close_channel(p->p[0]);
197          if (list_remove(process_list, p, NULL))          if (list_remove(process_list, p, NULL))
198                  mem_free(p);                  efree(p);
199  }  }
200    
201  void  void
# Line 355  rpp_forward_request(REQUEST *req) Line 357  rpp_forward_request(REQUEST *req)
357    
358          if (!p)          if (!p)
359                  return 1;                  return 1;
360          radlog(L_DEBUG, "sending request to %d", p->pid);          debug(1, ("sending request to %d", p->pid));
361                    
362          frq.type = req->type;          frq.type = req->type;
363          frq.addr = req->addr;          frq.addr = req->addr;
# Line 455  rpp_request_handler(void *arg ARG_UNUSED Line 457  rpp_request_handler(void *arg ARG_UNUSED
457                  repl.code = request_handle(req, request_respond);                  repl.code = request_handle(req, request_respond);
458                                                    
459                  /* Inform the master */                  /* Inform the master */
460                  radlog(L_DEBUG, "notifying the master");                  debug(1, ("notifying the master"));
461                  repl.size = req->update_size;                  repl.size = req->update_size;
462                  rpp_fd_write(1, &repl, sizeof repl);                  rpp_fd_write(1, &repl, sizeof repl);
463                  if (req->update) {                  if (req->update) {
# Line 487  rpp_input_handler(int fd, void *data) Line 489  rpp_input_handler(int fd, void *data)
489                  }                  }
490    
491                  if (p) {                  if (p) {
492                          radlog(L_DEBUG, "updating pid %d", p->pid);                          debug(1, ("updating pid %d", p->pid));
493                          p->ready = 1;                          p->ready = 1;
494                          request_update(p->pid, RS_COMPLETED, data);                          request_update(p->pid, RS_COMPLETED, data);
495                  }                  }

Legend:
Removed from v.1.7  
changed lines
  Added in v.1.8

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