[Groonga-commit] groonga/groonga [master] httpd: handle when groonga_database isn't specified

Back to archive index

null+****@clear***** null+****@clear*****
2012年 6月 28日 (木) 13:16:49 JST


Ryo Onodera	2012-06-28 13:16:49 +0900 (Thu, 28 Jun 2012)

  New Revision: 4e1f12be07614df66bc6273696d3420930fd695d
  https://github.com/groonga/groonga/commit/4e1f12be07614df66bc6273696d3420930fd695d

  Log:
    httpd: handle when groonga_database isn't specified

  Modified files:
    src/nginx-module/ngx_http_groonga_module.c

  Modified: src/nginx-module/ngx_http_groonga_module.c (+10 -0)
===================================================================
--- src/nginx-module/ngx_http_groonga_module.c    2012-06-28 11:47:10 +0900 (dca8455)
+++ src/nginx-module/ngx_http_groonga_module.c    2012-06-28 13:16:49 +0900 (83917dc)
@@ -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;
 }
 
-------------- next part --------------
HTML$B$NE:IU%U%!%$%k$rJ]4I$7$^$7$?(B...
Download 



Groonga-commit メーリングリストの案内
Back to archive index