[Groonga-commit] groonga/groonga at 7eb1659 [master] http: return error response as soon as possible

Back to archive index

Kouhei Sutou null+****@clear*****
Sat Jun 7 14:51:37 JST 2014


Kouhei Sutou	2014-06-07 14:51:37 +0900 (Sat, 07 Jun 2014)

  New Revision: 7eb1659a0e7c76d2367661e3e9d64d77daefc12c
  https://github.com/groonga/groonga/commit/7eb1659a0e7c76d2367661e3e9d64d77daefc12c

  Message:
    http: return error response as soon as possible

  Modified files:
    src/groonga.c

  Modified: src/groonga.c (+8 -2)
===================================================================
--- src/groonga.c    2014-06-07 14:47:54 +0900 (79a788c)
+++ src/groonga.c    2014-06-07 14:51:37 +0900 (2ea52b3)
@@ -958,6 +958,14 @@ do_htreq_post(grn_ctx *ctx, grn_msg *msg)
     return;
   }
 
+  grn_ctx_send(ctx, header.path_start, header.path_length, GRN_CTX_QUIET);
+  if (ctx->rc != GRN_SUCCESS) {
+    ht_context context;
+    context.msg = msg;
+    h_output(ctx, GRN_CTX_TAIL, &context);
+    return;
+  }
+
   if (header.have_100_continue) {
     const char *continue_message = "HTTP/1.1 100 Continue\r\n";
     ssize_t send_size;
@@ -969,8 +977,6 @@ do_htreq_post(grn_ctx *ctx, grn_msg *msg)
     }
   }
 
-  grn_ctx_send(ctx, header.path_start, header.path_length, GRN_CTX_QUIET);
-
   {
     grn_obj line_buffer;
     int read_content_length = 0;
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Back to archive index