Junk data could get inserted when saving/getting HTTP headers, as discovered
by Craig Davison. Now we deal with the 'nread' variable correctly between each header line.
This commit is contained in:
parent
91b84b89e4
commit
c3cc616264
@ -302,6 +302,9 @@ CURLcode Curl_readwrite(struct connectdata *conn,
|
|||||||
break; /* read more and try again */
|
break; /* read more and try again */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* decrease the size of the remaining buffer */
|
||||||
|
nread -= (k->end_ptr - k->str)+1;
|
||||||
|
|
||||||
k->str = k->end_ptr + 1; /* move past new line */
|
k->str = k->end_ptr + 1; /* move past new line */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -696,13 +699,6 @@ CURLcode Curl_readwrite(struct connectdata *conn,
|
|||||||
there might be a non-header part left in the end of the read
|
there might be a non-header part left in the end of the read
|
||||||
buffer. */
|
buffer. */
|
||||||
|
|
||||||
if (!k->header) {
|
|
||||||
/* starting here, this is not part of the header! */
|
|
||||||
|
|
||||||
/* we subtract the remaining header size from the buffer */
|
|
||||||
nread -= (k->str - k->buf);
|
|
||||||
}
|
|
||||||
|
|
||||||
} /* end if header mode */
|
} /* end if header mode */
|
||||||
|
|
||||||
/* This is not an 'else if' since it may be a rest from the header
|
/* This is not an 'else if' since it may be a rest from the header
|
||||||
|
Loading…
x
Reference in New Issue
Block a user