#include <freeradius-devel/rad_assert.h>
#ifdef INADDR_ANY
-#undef INADDR_ANY
+# undef INADDR_ANY
#endif
#include <EXTERN.h>
#include <perl.h>
char const *xlat_name;
char const *perl_flags;
PerlInterpreter *perl;
- bool perl_parsed;
+ bool perl_parsed;
pthread_key_t *thread_key;
#ifdef USE_ITHREADS
EXTERN_C void boot_DynaLoader(pTHX_ CV* cv);
#ifdef USE_ITHREADS
-#define dl_librefs "DynaLoader::dl_librefs"
-#define dl_modules "DynaLoader::dl_modules"
+# define dl_librefs "DynaLoader::dl_librefs"
+# define dl_modules "DynaLoader::dl_modules"
static void rlm_perl_clear_handles(pTHX)
{
AV *librefs = get_av(dl_librefs, false);
handles = (void **)rad_malloc(sizeof(void *) * (AvFILL(librefs)+2));
- for (i=0; i<=AvFILL(librefs); i++) {
+ for (i = 0; i <= AvFILL(librefs); i++) {
void *handle;
SV *handle_sv = *av_fetch(librefs, i, false);
-
- if(!handle_sv) {
- ERROR("Could not fetch $%s[%d]!\n",
- dl_librefs, (int)i);
+ if (!handle_sv) {
+ ERROR("Could not fetch $%s[%d]!", dl_librefs, (int)i);
continue;
}
handle = (void *)SvIV(handle_sv);
- if (handle) {
- handles[i] = handle;
- }
+ if (handle) handles[i] = handle;
}
av_clear(modules);
return;
}
- for (i=0; handles[i]; i++) {
- DEBUG("close %p\n", handles[i]);
+ for (i = 0; handles[i]; i++) {
+ DEBUG("Close %p", handles[i]);
dlclose(handles[i]);
}
* FIXME: This shouldn't happen
*
*/
- while (PL_scopestack_ix > 1 ){
+ while (PL_scopestack_ix > 1) {
LEAVE;
}
{
dTHXa(interp);
}
-#if PERL_REVISION >= 5 && PERL_VERSION <8
+# if PERL_REVISION >= 5 && PERL_VERSION <8
call_pv("CLONE",0);
-#endif
+# endif
ptr_table_free(PL_ptr_table);
PL_ptr_table = NULL;
#endif
/*
- * This is wrapper for radlog
- * Now users can call radiusd::radlog(level,msg) wich is the same
- * calling radlog from C code.
+ * This is wrapper for radlog
+ * Now users can call radiusd::radlog(level,msg) wich is the same
+ * calling radlog from C code.
*/
static XS(XS_radiusd_radlog)
{
}
/*
- * The xlat function
+ * The xlat function
*/
static ssize_t perl_xlat(void *instance, REQUEST *request, char const *fmt, char *out, size_t freespace)
{
char const **embed_c; /* Stupid Perl and lack of const consistency */
char **embed;
char **envp = NULL;
- char const xlat_name;
+ char const *xlat_name;
int exitstatus = 0, argc=0;
CONF_SECTION *cs;
#endif
xlat_name = cf_section_name2(conf);
- if (!xlat_name)
- xlat_name = cf_section_name1(conf);
- if (xlat_name) {
- xlat_register(xlat_name, perl_xlat, NULL, inst);
- }
+ if (!xlat_name) xlat_name = cf_section_name1(conf);
+ if (xlat_name) xlat_register(xlat_name, perl_xlat, NULL, inst);
exitstatus = perl_parse(inst->perl, xs_init, argc, embed, NULL);
SPAGAIN;
if (SvTRUE(ERRSV)) {
- ERROR("rlm_perl: perl_embed:: module = %s , func = %s exit status= %s\n",
- inst->module,
- function_name, SvPV(ERRSV,n_a));
+ RDEBUG("perl_embed:: module = %s , func = %s exit status= %s\n",
+ inst->module, function_name, SvPV(ERRSV,n_a));
(void)POPs;
}
if ((pair = pairfind(request->packet->vps, PW_ACCT_STATUS_TYPE, 0, TAG_ANY)) != NULL) {
acctstatustype = pair->vp_integer;
} else {
- ERROR("Invalid Accounting Packet");
+ RDEBUG("Invalid Accounting Packet");
return RLM_MODULE_INVALID;
}
rlm_perl_t *inst = (rlm_perl_t *) instance;
int exitstatus = 0, count = 0;
- if (inst->rad_perlconf_hv != NULL) {
- hv_undef(inst->rad_perlconf_hv);
- }
+ if (inst->rad_perlconf_hv != NULL) hv_undef(inst->rad_perlconf_hv);
if (inst->perl_parsed && inst->func_detach) {
dTHXa(inst->perl);
mod_authenticate, /* authenticate */
mod_authorize, /* authorize */
mod_preacct, /* preacct */
- mod_accounting, /* accounting */
+ mod_accounting, /* accounting */
mod_checksimul, /* check simul */
#ifdef WITH_PROXY
mod_pre_proxy, /* pre-proxy */
- mod_post_proxy, /* post-proxy */
+ mod_post_proxy, /* post-proxy */
#else
NULL, NULL,
#endif