static char *
ngx_rtmp_record_merge_app_conf(ngx_conf_t *cf, void *parent, void *child)
{
    ngx_rtmp_record_app_conf_t     *prev = parent;
    ngx_rtmp_record_app_conf_t     *conf = child;
    ngx_rtmp_record_app_conf_t    **rracf;

    ngx_conf_merge_str_value(conf->path, prev->path, "");
    ngx_conf_merge_str_value(conf->suffix, prev->suffix, ".flv");
    ngx_conf_merge_size_value(conf->max_size, prev->max_size, 0);
    ngx_conf_merge_size_value(conf->max_frames, prev->max_frames, 0);
    ngx_conf_merge_value(conf->unique, prev->unique, 0);
    ngx_conf_merge_value(conf->append, prev->append, 0);
    ngx_conf_merge_value(conf->lock_file, prev->lock_file, 0);
    ngx_conf_merge_value(conf->notify, prev->notify, 0);
    ngx_conf_merge_msec_value(conf->interval, prev->interval,
                              (ngx_msec_t) NGX_CONF_UNSET);
    ngx_conf_merge_bitmask_value(conf->flags, prev->flags, 0);
    ngx_conf_merge_ptr_value(conf->url, prev->url, NULL);

    if (conf->flags) {
        rracf = ngx_array_push(&conf->rec);
        if (rracf == NULL) {
            return NGX_CONF_ERROR;
        }

        *rracf = conf;
    }

    return NGX_CONF_OK;
}
static char* ngx_http_gridfs_merge_loc_conf(ngx_conf_t* directive, void* void_parent, void* void_child) {
    ngx_http_gridfs_loc_conf_t* parent = void_parent;
    ngx_http_gridfs_loc_conf_t* child = void_child;

    /* TODO do we need to do more error checking here? */
    ngx_conf_merge_str_value(child->mongod_host, parent->mongod_host, "127.0.0.1:27017");
    ngx_conf_merge_str_value(child->gridfs_root_collection, parent->gridfs_root_collection, "fs");
    ngx_conf_merge_value(child->enable, parent->enable, 0);

    /* TODO requiring a gridfs_db setting - should we provide a default instead? */
    /* ngx_conf_merge_str_value(child->gridfs_db, parent->gridfs_db, ngx_string("gridfs")); */
    if (child->gridfs_db.data == NULL) {
        if (parent->gridfs_db.data) {
            child->gridfs_db.len = parent->gridfs_db.len;
            child->gridfs_db.data = parent->gridfs_db.data;
        } else if (child->enable) {
            ngx_conf_log_error(NGX_LOG_EMERG, directive, 0,
                               "Must provide a gridfs_db setting to use the GridFS module");
            return NGX_CONF_ERROR;
        } else { /* TODO what do we do here? */
        }
    }

    return NGX_CONF_OK;
}
static char *
ngx_http_aws_auth_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child)
{
    ngx_http_aws_auth_conf_t *prev = parent;
    ngx_http_aws_auth_conf_t *conf = child;

    ngx_conf_merge_str_value(conf->access_key, prev->access_key, "");
    ngx_conf_merge_str_value(conf->key_scope, prev->key_scope, "");
    ngx_conf_merge_str_value(conf->signing_key, prev->signing_key, "");
    ngx_conf_merge_str_value(conf->endpoint, prev->endpoint, "s3.amazonaws.com");
    ngx_conf_merge_str_value(conf->bucket_name, prev->bucket_name, "");

    if(conf->signing_key_decoded.data == NULL)
    {
        conf->signing_key_decoded.data = ngx_pcalloc(cf->pool, 100);
        if(conf->signing_key_decoded.data == NULL)
        {
            return NGX_CONF_ERROR;
        }
    }

    if(conf->signing_key.len > 64) {
        return NGX_CONF_ERROR;
    } else {
        ngx_decode_base64(&conf->signing_key_decoded, &conf->signing_key);
    }

    return NGX_CONF_OK;
}
static char *
ngx_rtmp_play_merge_app_conf(ngx_conf_t *cf, void *parent, void *child)
{
    ngx_rtmp_play_app_conf_t *prev = parent;
    ngx_rtmp_play_app_conf_t *conf = child;
    ngx_rtmp_play_entry_t   **ppe;

    ngx_conf_merge_str_value(conf->temp_path, prev->temp_path, "/tmp");
    ngx_conf_merge_str_value(conf->local_path, prev->local_path, "");

    if (prev->entries.nelts == 0) {
        return NGX_CONF_OK;
    }

    if (conf->entries.nelts == 0) {
        conf->entries = prev->entries;
        return NGX_CONF_OK;
    }

    ppe = ngx_array_push_n(&conf->entries, prev->entries.nelts);
    if (ppe == NULL) {
        return NGX_CONF_ERROR;
    }

    ngx_memcpy(ppe, prev->entries.elts, prev->entries.nelts * sizeof(void *));

    return NGX_CONF_OK;
}
static char *
ngx_http_xss_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child)
{
    ngx_http_xss_loc_conf_t *prev = parent;
    ngx_http_xss_loc_conf_t *conf = child;

    ngx_conf_merge_str_value(conf->callback_arg, prev->callback_arg, "");

    ngx_conf_merge_value(conf->get_enabled, prev->get_enabled, 0);

    ngx_conf_merge_value(conf->check_status, prev->check_status, 1);

    ngx_conf_merge_value(conf->override_status, prev->override_status, 1);

#if defined(nginx_version) && nginx_version >= 8029
    if (ngx_http_merge_types(cf, &conf->input_types_keys, &conf->input_types,
                             &prev->input_types_keys, &prev->input_types,
                             ngx_http_xss_default_types)
        != NGX_OK)
#else /* 0.7.x or 0.8.x < 0.8.29 */
    if (ngx_http_merge_types(cf, conf->input_types_keys, &conf->input_types,
                             prev->input_types_keys, &prev->input_types,
                             ngx_http_xss_default_types)
        != NGX_OK)
#endif
    {
        return NGX_CONF_ERROR;
    }

    ngx_conf_merge_str_value(conf->output_type, prev->output_type,
                             ngx_http_xss_default_output_type);

    return NGX_CONF_OK;
}
static char *
ngx_http_auth_ldap_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child) {
    ngx_http_auth_ldap_loc_conf_t *prev = parent;
    ngx_http_auth_ldap_loc_conf_t *conf = child;

    if (conf->realm.data == NULL) {
	conf->realm = prev->realm;
    }

    ngx_conf_merge_str_value(conf->url, prev->url, "ldap://localhost/");
    ngx_conf_merge_str_value(conf->bind_dn, prev->bind_dn, "");
    ngx_conf_merge_str_value(conf->bind_dn_passwd, prev->bind_dn_passwd, "");
    ngx_conf_merge_str_value(conf->group_attribute, prev->group_attribute, "member");

    ngx_conf_merge_value(conf->require_valid_user, prev->require_valid_user, 0);
    ngx_conf_merge_value(conf->satisfy_all, prev->satisfy_all, 0);
    ngx_conf_merge_value(conf->group_attribute_dn, prev->group_attribute_dn, 1);

    if (conf->require_user == NULL) {
	conf->require_user = prev->require_user;
    }

    if (conf->require_group == NULL) {
	conf->require_group = prev->require_group;
    }

    if (conf->ludpp == NULL) {
	conf->ludpp = prev->ludpp;
    }

    return NGX_CONF_OK;
}
static char *
ngx_rtmp_record_merge_app_conf(ngx_conf_t *cf, void *parent, void *child)
{
    ngx_rtmp_record_app_conf_t *prev = parent;
    ngx_rtmp_record_app_conf_t *conf = child;
    ngx_rtmp_record_node_t    **node;

    ngx_conf_merge_str_value(conf->def.path, prev->def.path, "");
    ngx_conf_merge_str_value(conf->def.suffix, prev->def.suffix, ".flv");
    ngx_conf_merge_size_value(conf->def.max_size, prev->def.max_size, 0);
    ngx_conf_merge_size_value(conf->def.max_frames, prev->def.max_frames, 0);
    ngx_conf_merge_value(conf->def.unique, prev->def.unique, 0);
    ngx_conf_merge_msec_value(conf->def.interval, prev->def.interval, 
                              (ngx_msec_t) NGX_CONF_UNSET);
    ngx_conf_merge_bitmask_value(conf->def.flags, prev->def.flags, 0);
    ngx_conf_merge_ptr_value(conf->def.url, prev->def.url, NULL);

    if (conf->def.flags) {
        node = ngx_array_push(&conf->nodes);
        if (node == NULL) {
            return NGX_CONF_ERROR;
        }

        *node = &conf->def;
    }

    return NGX_CONF_OK;
}
static char *
ngx_mail_throttle_merge_srv_conf(ngx_conf_t *cf, void *parent, void *child)
{
    ngx_mail_throttle_srv_conf_t *prev = parent;
    ngx_mail_throttle_srv_conf_t *conf = child;

    ngx_conf_merge_uint_value (conf->mail_login_ip_max,
                               prev->mail_login_ip_max, 1000);
    ngx_conf_merge_uint_value (conf->mail_login_user_max,
                               prev->mail_login_user_max, 100);
    ngx_conf_merge_msec_value (conf->mail_login_ip_ttl,
                               prev->mail_login_ip_ttl, 60000);
    ngx_conf_merge_msec_value (conf->mail_login_user_ttl,
                               prev->mail_login_user_ttl, 60000);
    ngx_conf_merge_str_value (conf->mail_login_ip_rejectmsg,
                              prev->mail_login_ip_rejectmsg, "");
    ngx_conf_merge_str_value (conf->mail_login_user_rejectmsg,
                              prev->mail_login_user_rejectmsg, "");
    ngx_conf_merge_str_value (conf->mail_login_ip_ttl_text,
                              prev->mail_login_ip_ttl_text, "60");
    ngx_conf_merge_str_value (conf->mail_login_user_ttl_text,
                              prev->mail_login_user_ttl_text, "60");

    return NGX_CONF_OK;
}
static char* ngx_http_gridfs_merge_loc_conf(ngx_conf_t* directive, void* void_parent, void* void_child) {
    ngx_http_gridfs_loc_conf_t* parent = void_parent;
    ngx_http_gridfs_loc_conf_t* child = void_child;

    ngx_conf_merge_str_value(child->gridfs_db, parent->gridfs_db, "gridfs");    
    ngx_conf_merge_str_value(child->gridfs_root_collection,
			     parent->gridfs_root_collection, "fs");
    ngx_conf_merge_str_value(child->gridfs_field, parent->gridfs_field, "_id");
    ngx_conf_merge_uint_value(child->gridfs_type, parent->gridfs_type, bson_oid);
    ngx_conf_merge_ptr_value(child->gridfs_conn, parent->gridfs_conn, NGX_CONF_UNSET_PTR);

    /* Currently only support for "_id" and "filename" */ 
    if (child->gridfs_field.data != NULL
	&& ngx_strcmp(child->gridfs_field.data, "filename") != 0 
	&& ngx_strcmp(child->gridfs_field.data, "_id") != 0) {
      ngx_conf_log_error(NGX_LOG_EMERG, directive, 0, 
			 "Unsupported Field: %s", child->gridfs_field.data);
      return NGX_CONF_ERROR;
    }
    if (child->gridfs_field.data != NULL 
	&& ngx_strcmp(child->gridfs_field.data, "filename") == 0 
	&& child->gridfs_type != bson_string) {
      ngx_conf_log_error(NGX_LOG_EMERG, directive, 0, 
			 "Field: filename, must be of Type: string");
      return NGX_CONF_ERROR;
    } 

    return NGX_CONF_OK;
}
static char* ngx_http_mongodb_rest_merge_loc_conf(ngx_conf_t* cf, void* void_parent, void* void_child){
  ngx_http_mongodb_rest_loc_conf_t *parent = void_parent;
  ngx_http_mongodb_rest_loc_conf_t *child = void_child;

  ngx_conf_merge_str_value(child->db, parent->db, NULL);
  ngx_conf_merge_str_value(child->collection, parent->collection, NULL);

  return NGX_CONF_OK;
}
static char *
ngx_rtmp_play_merge_app_conf(ngx_conf_t *cf, void *parent, void *child)
{
    ngx_rtmp_play_app_conf_t *prev = parent;
    ngx_rtmp_play_app_conf_t *conf = child;

    ngx_conf_merge_str_value(conf->root, prev->root, "");
    ngx_conf_merge_str_value(conf->temp_path, prev->temp_path, "/tmp");

    return NGX_CONF_OK;
}
static char *
ngx_http_video_thumbextractor_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child)
{
    ngx_http_video_thumbextractor_loc_conf_t *prev = parent;
    ngx_http_video_thumbextractor_loc_conf_t *conf = child;

    ngx_conf_merge_value(conf->enabled, prev->enabled, 0);

    ngx_conf_merge_null_value(conf->video_filename, prev->video_filename, NULL);
    ngx_conf_merge_null_value(conf->video_second, prev->video_second, NULL);
    ngx_conf_merge_null_value(conf->image_width, prev->image_width, NULL);
    ngx_conf_merge_null_value(conf->image_height, prev->image_height, NULL);
    ngx_conf_merge_null_value(conf->tile_sample_interval, prev->tile_sample_interval, NULL);
    ngx_conf_merge_null_value(conf->tile_cols, prev->tile_cols, NULL);
    ngx_conf_merge_null_value(conf->tile_max_cols, prev->tile_max_cols, NULL);
    ngx_conf_merge_null_value(conf->tile_rows, prev->tile_rows, NULL);
    ngx_conf_merge_null_value(conf->tile_max_rows, prev->tile_max_rows, NULL);
    ngx_conf_merge_null_value(conf->tile_margin, prev->tile_margin, NULL);
    ngx_conf_merge_null_value(conf->tile_padding, prev->tile_padding, NULL);
    ngx_conf_merge_str_value(conf->tile_color, prev->tile_color, "black");

    ngx_conf_merge_uint_value(conf->jpeg_baseline, prev->jpeg_baseline, 1);
    ngx_conf_merge_uint_value(conf->jpeg_progressive_mode, prev->jpeg_progressive_mode, 0);
    ngx_conf_merge_uint_value(conf->jpeg_optimize, prev->jpeg_optimize, 100);
    ngx_conf_merge_uint_value(conf->jpeg_smooth, prev->jpeg_smooth, 0);
    ngx_conf_merge_uint_value(conf->jpeg_quality, prev->jpeg_quality, 75);
    ngx_conf_merge_uint_value(conf->jpeg_dpi, prev->jpeg_dpi, 72); /** Screen resolution = 72 dpi */

    ngx_conf_merge_value(conf->only_keyframe, prev->only_keyframe, 1);
    ngx_conf_merge_value(conf->next_time, prev->next_time, 1);

    ngx_conf_merge_str_value(conf->threads, prev->threads, "auto");

    // if video thumb extractor is disable the other configurations don't have to be checked
    if (!conf->enabled) {
        return NGX_CONF_OK;
    }

    conf->next_time = conf->only_keyframe ? conf->next_time : 0;

    // sanity checks

    if (conf->video_filename == NULL) {
        ngx_conf_log_error(NGX_LOG_ERR, cf, 0, "video thumbextractor module: video_thumbextractor_video_filename must be defined");
        return NGX_CONF_ERROR;
    }

    if (conf->video_second == NULL) {
        ngx_conf_log_error(NGX_LOG_ERR, cf, 0, "video thumbextractor module: video_thumbextractor_video_second must be defined");
        return NGX_CONF_ERROR;
    }

    return NGX_CONF_OK;
}
static char* ngx_http_hls_merge_loc_conf(ngx_conf_t *cf ,void *parent,void *child)
{
	ngx_http_hls_loc_conf_t *prev = parent;
	ngx_http_hls_loc_conf_t *next = child;

	ngx_conf_merge_str_value(next->media_type,prev->media_type,"");
	ngx_conf_merge_str_value(next->media_path,prev->media_path,"");

	return NGX_OK;
	
}
static char *
ngx_http_accesskey_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child)
{
    ngx_http_accesskey_loc_conf_t  *prev = parent;
    ngx_http_accesskey_loc_conf_t  *conf = child;
    ngx_conf_merge_value(conf->enable, prev->enable, 0);
    ngx_conf_merge_uint_value(conf->hashmethod, prev->hashmethod, NGX_ACCESSKEY_MD5);
    ngx_conf_merge_str_value(conf->arg, prev->arg, "key");
    ngx_conf_merge_str_value(conf->signature,prev->signature,"$remote_addr");
    return ngx_http_accesskey_compile_signature(cf, conf);
}
static char *
ngx_http_addition_merge_conf(ngx_conf_t *cf, void *parent, void *child)
{
    ngx_http_addition_conf_t *prev = parent;
    ngx_http_addition_conf_t *conf = child;

    ngx_conf_merge_str_value(conf->before_body, prev->before_body, "");
    ngx_conf_merge_str_value(conf->after_body, prev->after_body, "");

    return NGX_CONF_OK;
}
static char *
ngx_http_stat_report_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child)
{
    ngx_http_stat_report_conf_t *prev = (ngx_http_stat_report_conf_t *)parent;
    ngx_http_stat_report_conf_t *conf = (ngx_http_stat_report_conf_t *)child;

    ngx_conf_merge_str_value(conf->host, prev->host, "");
    ngx_conf_merge_value(conf->port, prev->port, 0);
    ngx_conf_merge_str_value(conf->collect_point, prev->collect_point, "");

    return NGX_CONF_OK;
}
static char *
ngx_http_image_filter_merge_conf(ngx_conf_t *cf, void *parent, void *child)
{
    ngx_http_image_filter_conf_t *prev = parent;
    ngx_http_image_filter_conf_t *conf = child;

    if (conf->filter == NGX_CONF_UNSET_UINT) {

        if (prev->filter == NGX_CONF_UNSET_UINT) {
            conf->filter = NGX_HTTP_IMAGE_OFF;

        } else {
            conf->filter = prev->filter;
            conf->width = prev->width;
            conf->height = prev->height;
            conf->angle = prev->angle;
            conf->wcv = prev->wcv;
            conf->hcv = prev->hcv;
            conf->acv = prev->acv;
        }
    }

    if (conf->jpeg_quality == NGX_CONF_UNSET_UINT) {

        /* 75 is libjpeg default quality */
        ngx_conf_merge_uint_value(conf->jpeg_quality, prev->jpeg_quality, 75);

        if (conf->jqcv == NULL) {
            conf->jqcv = prev->jqcv;
        }
    }

    if (conf->sharpen == NGX_CONF_UNSET_UINT) {
        ngx_conf_merge_uint_value(conf->sharpen, prev->sharpen, 0);

        if (conf->shcv == NULL) {
            conf->shcv = prev->shcv;
        }
    }

    ngx_conf_merge_value(conf->transparency, prev->transparency, 1);

    ngx_conf_merge_value(conf->interlace, prev->interlace, 0);

    ngx_conf_merge_size_value(conf->buffer_size, prev->buffer_size,
                              1 * 1024 * 1024);

    ngx_conf_merge_str_value(conf->watermark, prev->watermark, "");

    ngx_conf_merge_str_value(conf->watermark_position, prev->watermark_position, "bottom-right");

    return NGX_CONF_OK;
}
static char *
ngx_captcha_access_filter_merge_loc_conf( ngx_conf_t *cf, void *parent, void *child ) {

    ngx_captcha_access_filter_loc_conf_t *prev = parent;
    ngx_captcha_access_filter_loc_conf_t *conf = child;

    ngx_conf_merge_str_value( conf->private_key, prev->private_key, "null" );
    ngx_conf_merge_str_value( conf->verify_url, prev->verify_url, "http://www.google.com/recaptcha/api/verify" );
    ngx_conf_merge_value( conf->enable, prev->enable, 0 );

    return NGX_CONF_OK;
}
static char *ngx_proc_luashm_backup_merge_conf(ngx_conf_t *cf, void *parent, void *child)
{
    ngx_proc_luashm_backup_conf_t  *prev = parent;
    ngx_proc_luashm_backup_conf_t  *conf = child;

    //ngx_conf_merge_uint_value(conf->port, prev->port, 0);
    ngx_conf_merge_str_value(conf->path, prev->path, NULL);
	ngx_conf_merge_str_value(conf->settimestamp, prev->settimestamp, NULL);
	ngx_conf_merge_ptr_value(conf->shdict_names, prev->shdict_names, NGX_CONF_UNSET_PTR);

    return NGX_CONF_OK;
}
static char * ngx_http_authnz_pam_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child)
{
    ngx_http_authnz_pam_loc_conf_t *prev = parent;
    ngx_http_authnz_pam_loc_conf_t *conf = child;

    ngx_conf_merge_off_value(conf->basic_auth, prev->basic_auth, 0);
    ngx_conf_merge_off_value(conf->active, prev->active, 0);
    ngx_conf_merge_str_value(conf->name, prev->name, _DEFAULT_PAM_REALM);
    ngx_conf_merge_str_value(conf->pam_service_name, prev->pam_service_name, "");
    ngx_conf_merge_str_value(conf->expired_redirect_url, prev->expired_redirect_url, "");

    return NGX_CONF_OK;
}
static char *
ngx_http_vod_hds_merge_loc_conf(
	ngx_conf_t *cf,
	ngx_http_vod_loc_conf_t *base,
	ngx_http_vod_hds_loc_conf_t *conf,
	ngx_http_vod_hds_loc_conf_t *prev)
{
	ngx_conf_merge_str_value(conf->manifest_config.fragment_file_name_prefix, prev->manifest_config.fragment_file_name_prefix, "frag");
	ngx_conf_merge_str_value(conf->manifest_file_name_prefix, prev->manifest_file_name_prefix, "manifest");
	ngx_conf_merge_value(conf->fragment_config.generate_moof_atom, prev->fragment_config.generate_moof_atom, 1);

	return NGX_CONF_OK;
}
static char*
ngx_http_gettoken_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child)
{
    ngx_http_gettoken_loc_conf_t *prev = parent;
    ngx_http_gettoken_loc_conf_t *conf = child;
    ngx_conf_merge_value(conf->enable, prev->enable, 0);
    ngx_conf_merge_str_value(conf->auth_host, prev->auth_host, "");
    ngx_conf_merge_str_value(conf->auth_url, prev->auth_url, "");
    ngx_conf_merge_str_value(conf->token_host, prev->token_host, "");
    ngx_conf_merge_str_value(conf->token_url, prev->token_url, "");
    ngx_conf_merge_ptr_value(conf->servers, prev->servers, NULL);
    return    NGX_CONF_OK;

}
static char *
ngx_http_corley_merge_conf(ngx_conf_t *cf, void *parent, void *child)
{
    ngx_http_corley_conf_t *prev = parent;
    ngx_http_corley_conf_t *conf = child;

    ngx_conf_merge_value(conf->enable, prev->enable, 0);

    ngx_conf_merge_str_value(conf->keyid, prev->keyid, "");
    ngx_conf_merge_str_value(conf->key, prev->key, "");
    ngx_conf_merge_str_value(conf->queue_name, prev->queue_name, "");
    
    return NGX_CONF_OK;
}
Beispiel #24
0
static char *
ngx_http_aws_auth_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child)
{
    register_variable(cf);

    ngx_http_aws_auth_conf_t *prev = parent;
    ngx_http_aws_auth_conf_t *conf = child;

    ngx_conf_merge_str_value(conf->access_key, prev->access_key, "");
    ngx_conf_merge_str_value(conf->secret, prev->secret, "");
    ngx_conf_merge_str_value(conf->chop_prefix, prev->chop_prefix, "");

    return NGX_CONF_OK;
}
static char *
ngx_http_groonga_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child)
{
  ngx_http_groonga_loc_conf_t *prev = parent;
  ngx_http_groonga_loc_conf_t *conf = child;

  ngx_conf_merge_str_value(conf->database_path, prev->database_path, NULL);
  ngx_conf_merge_value(conf->database_auto_create,
                       prev->database_auto_create,
                       GRN_TRUE);
  ngx_conf_merge_size_value(conf->cache_limit, prev->cache_limit,
                            GRN_CACHE_DEFAULT_MAX_N_ENTRIES);

#ifdef NGX_HTTP_GROONGA_LOG_PATH
  {
    ngx_str_t default_log_path;
    default_log_path.data = (u_char *)NGX_HTTP_GROONGA_LOG_PATH;
    default_log_path.len = strlen(NGX_HTTP_GROONGA_LOG_PATH);
    conf->log_file = ngx_conf_open_file(cf->cycle, &default_log_path);
    if (!conf->log_file) {
      ngx_log_error(NGX_LOG_ERR, cf->cycle->log, 0,
                    "http_groonga: "
                    "failed to open the default groonga log file: <%V>",
                    &default_log_path);
      return NGX_CONF_ERROR;
    }
  }
#else
  conf->log_file = NULL;
#endif

  ngx_conf_merge_str_value(conf->query_log_path, prev->query_log_path,
                           NGX_HTTP_GROONGA_QUERY_LOG_PATH);
  if (!conf->query_log_file &&
      ngx_str_is_custom_path(&(conf->query_log_path)) &&
      conf->enabled) {
    conf->query_log_file = ngx_conf_open_file(cf->cycle,
                                              &(conf->query_log_path));
    if (!conf->query_log_file) {
      ngx_log_error(NGX_LOG_ERR, cf->cycle->log, 0,
                    "http_groonga: "
                    "failed to open the default groonga query log file: <%V>",
                    &(conf->query_log_path));
      return NGX_CONF_ERROR;
    }
  }

  return NGX_CONF_OK;
}
static char *
ngx_http_auth_radius_merge_loc_conf( ngx_conf_t *cf, void *parent, void *child ) {

    ngx_http_auth_radius_main_conf_t *prev = parent;
    ngx_http_auth_radius_main_conf_t *conf = child;

    ngx_conf_merge_str_value( conf->realm, prev->realm, "" );
    ngx_conf_merge_str_value( conf->radius_cache, prev->radius_cache, "" );

    ngx_conf_merge_msec_value( conf->radius_timeout, prev->radius_timeout, 60000 );
    ngx_conf_merge_uint_value( conf->radius_attempts, prev->radius_attempts, 3 );

    return NGX_CONF_OK;

}
static char *
ngx_http_addition_merge_conf(ngx_conf_t *cf, void *parent, void *child)
{
    ngx_http_addition_conf_t *prev = parent;
    ngx_http_addition_conf_t *conf = child;

    ngx_conf_merge_str_value(conf->before_body, prev->before_body, "");
    ngx_conf_merge_str_value(conf->after_body, prev->after_body, "");

    if (ngx_http_merge_types(cf, &conf->types_keys, &conf->types, &prev->types_keys, &prev->types, ngx_http_html_default_types) != NGX_OK) {
        return NGX_CONF_ERROR;
    }

    return NGX_CONF_OK;
}
static char *
ngx_http_slice_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child)
{
    ngx_http_slice_loc_conf_t  *prev = parent;
    ngx_http_slice_loc_conf_t  *conf = child;

    ngx_conf_merge_str_value(conf->begin, prev->begin, "begin");
    ngx_conf_merge_str_value(conf->end, prev->end, "end");
    ngx_conf_merge_str_value(conf->header, prev->header, "");
    ngx_conf_merge_str_value(conf->footer, prev->footer, "");
    ngx_conf_merge_value(conf->header_first, prev->header_first, 1);
    ngx_conf_merge_value(conf->footer_last, prev->footer_last, 1);

    return NGX_CONF_OK;
}
static char *
ngx_mail_core_merge_srv_conf(ngx_conf_t *cf, void *parent, void *child)
{
    ngx_mail_core_srv_conf_t *prev = parent;
    ngx_mail_core_srv_conf_t *conf = child;

    ngx_conf_merge_msec_value(conf->timeout, prev->timeout, 60000);
    ngx_conf_merge_msec_value(conf->resolver_timeout, prev->resolver_timeout,
                              30000);

    ngx_conf_merge_value(conf->so_keepalive, prev->so_keepalive, 0);


    ngx_conf_merge_str_value(conf->server_name, prev->server_name, "");

    if (conf->server_name.len == 0) {
        conf->server_name = cf->cycle->hostname;
    }

    if (conf->protocol == NULL) {
        ngx_log_error(NGX_LOG_EMERG, cf->log, 0,
                      "unknown mail protocol for server in %s:%ui",
                      conf->file_name, conf->line);
        return NGX_CONF_ERROR;
    }

    ngx_conf_merge_ptr_value(conf->resolver, prev->resolver, NULL);

    return NGX_CONF_OK;
}
Beispiel #30
0
static char *
ngx_http_bizlog_merge_srv_conf(ngx_conf_t *cf, void *parent, void *child)
{
    bizlog_svr_conf_t *prev = (bizlog_svr_conf_t*)parent;
    bizlog_svr_conf_t *conf = (bizlog_svr_conf_t*)child;

	ngx_conf_merge_value(conf->log_level, prev->log_level, (ngx_int_t)NL_INFO);
	ngx_conf_merge_value(conf->enable, prev->enable, 0);
	ngx_conf_merge_str_value(conf->logfile, prev->logfile, "logs/ngx_biz.log");
	ngx_conf_merge_str_value(conf->debugfile, prev->debugfile, "logs/ngx_biz.debug");

	if(conf->enable){
		return ngx_http_bizlog_init(cf, conf);
	}
   return NGX_CONF_OK;
}