feat(lnm): move request data to separate buffer if read buffer changes
This commit is contained in:
parent
d53a949946
commit
8bdf52da0d
6 changed files with 88 additions and 24 deletions
|
|
@ -8,7 +8,8 @@ lnm_http_step_err lander_remove_entry(lnm_http_conn *conn) {
|
|||
lnm_http_loop_gctx *gctx = ctx->g;
|
||||
lander_gctx *c_gctx = gctx->c;
|
||||
|
||||
const char *key_s = &ctx->req.path.s[ctx->req.path.groups[1].rm_so];
|
||||
const char *key_s =
|
||||
&ctx->req.buf.s[ctx->req.path.o + ctx->req.path.groups[1].rm_so];
|
||||
int key_len = ctx->req.path.groups[1].rm_eo - ctx->req.path.groups[1].rm_so;
|
||||
|
||||
lsm_str *key;
|
||||
|
|
|
|||
|
|
@ -118,7 +118,8 @@ lnm_http_step_err lander_get_entry(lnm_http_conn *conn) {
|
|||
lnm_http_loop_gctx *gctx = ctx->g;
|
||||
lander_gctx *c_gctx = gctx->c;
|
||||
|
||||
const char *key_s = &ctx->req.path.s[ctx->req.path.groups[1].rm_so];
|
||||
const char *key_s =
|
||||
&ctx->req.buf.s[ctx->req.path.o + ctx->req.path.groups[1].rm_so];
|
||||
int key_len = ctx->req.path.groups[1].rm_eo - ctx->req.path.groups[1].rm_so;
|
||||
|
||||
lsm_str *key;
|
||||
|
|
|
|||
|
|
@ -38,7 +38,8 @@ bool lander_insert_entry(lnm_http_loop_ctx *ctx) {
|
|||
randomize_key(key_s, key_len);
|
||||
lsm_str_init(&key, key_s);
|
||||
} else {
|
||||
const char *key_s = &ctx->req.path.s[ctx->req.path.groups[2].rm_so];
|
||||
const char *key_s =
|
||||
&ctx->req.buf.s[ctx->req.path.o + ctx->req.path.groups[2].rm_so];
|
||||
key_len = ctx->req.path.groups[2].rm_eo - ctx->req.path.groups[2].rm_so;
|
||||
|
||||
lsm_str_init_copy_n(&key, key_s, key_len);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue