Beispiel #1
0
static liAction* proxy_create(liServer *srv, liWorker *wrk, liPlugin* p, liValue *val, gpointer userdata) {
	proxy_context *ctx;
	UNUSED(wrk); UNUSED(userdata);

	if (val->type != LI_VALUE_STRING) {
		ERROR(srv, "%s", "proxy expects a string as parameter");
		return FALSE;
	}

	ctx = proxy_context_new(srv, p, val->data.string);
	if (!ctx) return NULL;

	return li_action_new_function(proxy_handle, NULL, proxy_free, ctx);
}
Beispiel #2
0
static liAction* proxy_create(liServer *srv, liWorker *wrk, liPlugin* p, liValue *val, gpointer userdata) {
	proxy_context *ctx;
	UNUSED(wrk); UNUSED(userdata); UNUSED(p);

	val = li_value_get_single_argument(val);

	if (LI_VALUE_STRING != li_value_type(val)) {
		ERROR(srv, "%s", "proxy expects a string as parameter");
		return FALSE;
	}

	ctx = proxy_context_new(srv, val->data.string);
	if (NULL == ctx) return NULL;

	return li_action_new_function(proxy_handle, proxy_handle_abort, proxy_free, ctx);
}