- Removed extern ECS config options
- module_restart_next now calls clear on all following modules
- Also create ECS module qstate on module_event_pass event
+ - remove malloc from inplace_cb_register
6 April 2017: Wouter
- Small fixup for documentation.
return 0;
}
inplace_cb_register((void*)ecs_whitelist_check, inplace_cb_query, NULL,
- 0, env, id);
+ env, id);
inplace_cb_register((void*)ecs_edns_back_parsed,
- inplace_cb_edns_back_parsed, NULL, 0, env, id);
+ inplace_cb_edns_back_parsed, NULL, env, id);
lock_rw_init(&sn_env->biglock);
return 1;
}
int
inplace_cb_register(void* cb, enum inplace_cb_list_type type, void* cbarg,
- size_t cbarg_len, struct module_env* env, int id)
+ struct module_env* env, int id)
{
struct inplace_cb* callback;
struct inplace_cb** prevp;
callback->id = id;
callback->next = NULL;
callback->cb = cb;
- if(cbarg) {
- if(!(callback->cb_arg = calloc(1, cbarg_len))){
- log_err("out of memory during edns callback argument"
- "registration.");
- free(callback);
- return 0;
- }
- memcpy(callback->cb_arg, cbarg, cbarg_len);
- }
prevp = (struct inplace_cb**) &env->inplace_cb_lists[type];
/* append at end of list */
* @param cb: pointer to the callback function.
* @param type: inplace callback type.
* @param cbarg: argument for the callback function, or NULL.
- * @param cbarg_len: size of cbars, or 0.
* @param env: the module environment.
* @param id: module id.
* @return true on success, false on failure (out of memory or trying to
*/
int
inplace_cb_register(void* cb, enum inplace_cb_list_type type, void* cbarg,
- size_t cbarg_len, struct module_env* env, int id);
+ struct module_env* env, int id);
/**
* Delete callback for specified type and module id.