Skip to content

Commit

Permalink
Generate request_id automatically when request_timeout is specified
Browse files Browse the repository at this point in the history
  • Loading branch information
kou committed Apr 2, 2016
1 parent 1db55e8 commit ecae2b2
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/ctx.c
Original file line number Diff line number Diff line change
Expand Up @@ -1510,6 +1510,9 @@ grn_ctx_qe_exec_uri(grn_ctx *ctx, const char *path, uint32_t path_len)
p = grn_text_cgidec(ctx, val, p, e, HTTP_QUERY_PAIRS_DELIMITERS);
}
}
if (request_timeout > 0 && GRN_TEXT_LEN(&request_id) == 0) {
grn_text_printf(ctx, &request_id, "%p", ctx);
}
if (GRN_TEXT_LEN(&request_id) > 0) {
GRN_TEXT_SET(ctx, &ctx->impl->current_request_id,
GRN_TEXT_VALUE(&request_id),
Expand Down Expand Up @@ -1627,6 +1630,9 @@ grn_ctx_qe_exec(grn_ctx *ctx, const char *str, uint32_t str_len)
break;
}
}
if (request_timeout > 0 && GRN_TEXT_LEN(&request_id) == 0) {
grn_text_printf(ctx, &request_id, "%p", ctx);
}
if (GRN_TEXT_LEN(&request_id) > 0) {
GRN_TEXT_SET(ctx, &ctx->impl->current_request_id,
GRN_TEXT_VALUE(&request_id),
Expand Down

0 comments on commit ecae2b2

Please sign in to comment.