Navigation Menu

Skip to content

Commit

Permalink
http: return error response as soon as possible
Browse files Browse the repository at this point in the history
  • Loading branch information
kou committed Jun 7, 2014
1 parent ed9af1f commit 7eb1659
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/groonga.c
Expand Up @@ -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;
Expand All @@ -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;
Expand Down

0 comments on commit 7eb1659

Please sign in to comment.