Ejemplo n.º 1
0
static ret_t
configure (cherokee_rule_not_t       *rule,
           cherokee_config_node_t    *conf,
           cherokee_virtual_server_t *vsrv)
{
	ret_t                   ret;
	cherokee_config_node_t *subconf = NULL;

	/* Get the configuration sub-tree
	 */
	ret = cherokee_config_node_get (conf, "right", &subconf);
	if (ret != ret_ok)
		return ret;

	/* Instance the sub-rule match
	 */
	ret = cherokee_virtual_server_new_rule (vsrv, subconf,
	                                        RULE(rule)->priority,
	                                        &rule->right);
	if (ret != ret_ok)
		return ret;

	if (rule->right == NULL)
		return ret_error;

	/* Let the child rule know about its parent
	 */
	rule->right->parent_rule = RULE(rule);

	return ret_ok;
}
Ejemplo n.º 2
0
static ret_t
configure_branch (cherokee_rule_and_t       *rule,
		  cherokee_config_node_t    *conf,
		  cherokee_virtual_server_t *vsrv,
		  const char                *branch,
		  cherokee_rule_t          **branch_rule)
{
	ret_t                   ret;
	cherokee_config_node_t *subconf = NULL;

	/* Get the configuration sub-tree
	 */
	ret = cherokee_config_node_get (conf, branch, &subconf);
	if (ret != ret_ok)
		return ret;

	/* Instance the sub-rule match
	 */
	ret = cherokee_virtual_server_new_rule (vsrv, subconf,
						RULE(rule)->priority,
						branch_rule);
	if (ret != ret_ok)
		return ret;

	return ret_ok;
}