Skip to content

Commit

Permalink
fixed the buffer pos bug in the streamming parser (untested yet)
Browse files Browse the repository at this point in the history
  • Loading branch information
agentzh committed Nov 29, 2009
1 parent 6219988 commit d0f998e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/ngx_http_memc_response.c
Expand Up @@ -165,9 +165,11 @@ ngx_http_memc_process_simple_header(ngx_http_request_t *r)

ctx->parser_state = cs;

resp.data = u->buffer.pos;
resp.data = u->buffer.start;
resp.len = p - resp.data;

u->buffer.pos = p;

dd("memcached response: (len: %d) %s", resp.len, resp.data);
dd("machine state: %d", cs);

Expand All @@ -176,8 +178,6 @@ ngx_http_memc_process_simple_header(ngx_http_request_t *r)

rc = ngx_http_memc_write_simple_response(r, u, status, &resp);

u->buffer.pos = p;

return rc;
}

Expand Down
6 changes: 3 additions & 3 deletions src/ngx_http_memc_response.rl
Expand Up @@ -125,9 +125,11 @@ ngx_http_memc_process_simple_header(ngx_http_request_t *r)

ctx->parser_state = cs;

resp.data = u->buffer.pos;
resp.data = u->buffer.start;
resp.len = p - resp.data;

u->buffer.pos = p;

dd("memcached response: (len: %d) %s", resp.len, resp.data);
dd("machine state: %d", cs);

Expand All @@ -136,8 +138,6 @@ ngx_http_memc_process_simple_header(ngx_http_request_t *r)

rc = ngx_http_memc_write_simple_response(r, u, status, &resp);

u->buffer.pos = p;

return rc;
}

Expand Down

0 comments on commit d0f998e

Please sign in to comment.