示例#1
0
/* Add new RR data */
int ub_ctx_data_add(struct ub_ctx* ctx, const char *data)
{
	int res = ub_ctx_finalize(ctx);
	if (res) return res;

	res = local_zones_add_RR(ctx->local_zones, data);
	return (!res) ? UB_NOMEM : UB_NOERROR;
}
示例#2
0
文件: remote.c 项目: RS-liuyang/rsdns
/** Add new RR data */
static void
do_data_add(SSL* ssl, struct worker* worker, char* arg)
{
	if(!local_zones_add_RR(worker->daemon->local_zones, arg,
		worker->env.scratch_buffer)) {
		ssl_printf(ssl,"error in syntax or out of memory, %s\n", arg);
		return;
	}
	send_ok(ssl);
}
示例#3
0
/* Add new RR data */
int ub_ctx_data_add(struct ub_ctx* ctx, char *data)
{
    ldns_buffer* buf;
    int res = ub_ctx_finalize(ctx);
    if (res) return res;

    lock_basic_lock(&ctx->cfglock);
    buf = ldns_buffer_new(ctx->env->cfg->msg_buffer_size);
    lock_basic_unlock(&ctx->cfglock);
    if(!buf) return UB_NOMEM;

    res = local_zones_add_RR(ctx->local_zones, data, buf);

    ldns_buffer_free(buf);
    return (!res) ? UB_NOMEM : UB_NOERROR;
}