[Groonga-commit] groonga/groonga [master] httpd: only GRN_TEXT_SET when body is empty

Back to archive index

null+****@clear***** null+****@clear*****
2012年 6月 22日 (金) 17:38:17 JST


Ryo Onodera	2012-06-22 17:38:17 +0900 (Fri, 22 Jun 2012)

  New Revision: ee93fc4e7c7b77d042ba6ef245e66c2f5c4aaba8
  https://github.com/groonga/groonga/commit/ee93fc4e7c7b77d042ba6ef245e66c2f5c4aaba8

  Log:
    httpd: only GRN_TEXT_SET when body is empty

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

  Modified: src/nginx-module/ngx_http_groonga_module.c (+7 -5)
===================================================================
--- src/nginx-module/ngx_http_groonga_module.c    2012-06-22 17:36:45 +0900 (449af22)
+++ src/nginx-module/ngx_http_groonga_module.c    2012-06-22 17:38:17 +0900 (6961d9f)
@@ -140,11 +140,13 @@ ngx_http_groonga_context_receive_handler(grn_ctx *context,
 
     grn_ctx_recv(context, &result, &result_size, &flags);
 
-    if (result_size || context->rc) {
-      GRN_TEXT_SET(context,
-                   &output->body,
-                   result,
-                   result_size);
+    if (result_size || GRN_TEXT_LEN(&output->body) || context->rc) {
+      if (!GRN_TEXT_LEN(&output->body)) {
+        GRN_TEXT_SET(context,
+                     &output->body,
+                     result,
+                     result_size);
+      }
 
       grn_output_envelope(context,
                           context->rc,
-------------- next part --------------
HTML$B$NE:IU%U%!%$%k$rJ]4I$7$^$7$?(B...
Download 



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