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 |
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 |
} |
} |
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 |
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; |
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) { |
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 |
} |
} |