[mod_fastcgi] minor: copy packet without padding

This commit is contained in:
Glenn Strauss 2018-11-18 17:04:02 -05:00
parent 758c58cda5
commit b5cd216781
1 changed files with 2 additions and 4 deletions

View File

@ -330,8 +330,8 @@ static int fastcgi_get_packet(server *srv, handler_ctx *hctx, fastcgi_response_p
static void fastcgi_get_packet_body(buffer *b, handler_ctx *hctx, fastcgi_response_packet *packet) {
/* copy content; hctx->rb must contain at least packet->len content */
size_t toread = packet->len;
buffer_string_prepare_append(b, packet->len);
size_t toread = packet->len - packet->padding;
buffer_string_prepare_append(b, toread);
for (chunk *c = hctx->rb->first; c; c = c->next) {
size_t weHave = buffer_string_length(c->mem) - c->offset;
if (weHave >= toread) {
@ -342,8 +342,6 @@ static void fastcgi_get_packet_body(buffer *b, handler_ctx *hctx, fastcgi_respon
buffer_append_string_len(b, c->mem->ptr + c->offset, weHave);
toread -= weHave;
}
buffer_string_set_length(b, buffer_string_length(b) - packet->padding);
chunkqueue_mark_written(hctx->rb, packet->len);
}