Skip to content

Commit

Permalink
httpd: handle when groonga_database isn't specified
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryo Onodera committed Jun 28, 2012
1 parent eed349d commit 4e1f12b
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/nginx-module/ngx_http_groonga_module.c
Expand Up @@ -337,11 +337,21 @@ ngx_http_groonga_create_loc_conf(ngx_conf_t *cf)
static char *
ngx_http_groonga_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child)
{
ngx_http_core_loc_conf_t *location_conf;
ngx_http_groonga_loc_conf_t *prev = parent;
ngx_http_groonga_loc_conf_t *conf = child;

ngx_conf_merge_str_value(conf->database, prev->database, NULL);

location_conf = ngx_http_conf_get_module_loc_conf(cf, ngx_http_core_module);
if (location_conf->handler == ngx_http_groonga_handler) {
if (conf->database.data == NULL) {
ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
"\"groonga_database\" must be specified");
return NGX_CONF_ERROR;
}
}

return NGX_CONF_OK;
}

Expand Down

0 comments on commit 4e1f12b

Please sign in to comment.