Robert Iakobashvili made the 'master_buffer' get allocated first once it is

can/will be used as it then makes the common cases save 16KB of data for each
easy handle that isn't used for pipelining.
This commit is contained in:
Daniel Stenberg
2007-04-24 10:18:06 +00:00
parent 6a35841b2e
commit bc1ae973da
6 changed files with 30 additions and 8 deletions

View File

@@ -289,8 +289,13 @@ static void read_rewind(struct connectdata *conn,
size_t show;
show = MIN(conn->buf_len - conn->read_pos, sizeof(buf)-1);
memcpy(buf, conn->master_buffer + conn->read_pos, show);
buf[show] = '\0';
if (conn->master_buffer) {
memcpy(buf, conn->master_buffer + conn->read_pos, show);
buf[show] = '\0';
}
else {
buf[0] = '\0';
}
DEBUGF(infof(conn->data,
"Buffer after stream rewind (read_pos = %d): [%s]",