RTSP followup fix. Both the pipelined and non-pipelined case need to

check for (excess > 0 && !k->ignorebody).
This commit is contained in:
Yang Tse 2010-01-29 01:16:23 +00:00
parent 15ddc1f134
commit fce02e1cab

View File

@ -619,28 +619,28 @@ static CURLcode readwrite_data(struct SessionHandle *data,
(k->bytecount + nread >= k->maxdownload)) { (k->bytecount + nread >= k->maxdownload)) {
excess = (size_t)(k->bytecount + nread - k->maxdownload); excess = (size_t)(k->bytecount + nread - k->maxdownload);
if(conn->data->multi && Curl_multi_canPipeline(conn->data->multi)) { if(excess > 0 && !k->ignorebody) {
/* The 'excess' amount below can't be more than BUFSIZE which if(conn->data->multi && Curl_multi_canPipeline(conn->data->multi)) {
always will fit in a size_t */ /* The 'excess' amount below can't be more than BUFSIZE which
if(excess > 0 && !k->ignorebody) { always will fit in a size_t */
infof(data, infof(data,
"Rewinding stream by : %zu" "Rewinding stream by : %zu"
" bytes on url %s (size = %" FORMAT_OFF_T " bytes on url %s (size = %" FORMAT_OFF_T
", maxdownload = %" FORMAT_OFF_T ", maxdownload = %" FORMAT_OFF_T
", bytecount = %" FORMAT_OFF_T ", nread = %zd)\n", ", bytecount = %" FORMAT_OFF_T ", nread = %zd)\n",
excess, data->state.path, excess, data->state.path,
k->size, k->maxdownload, k->bytecount, nread); k->size, k->maxdownload, k->bytecount, nread);
read_rewind(conn, excess); read_rewind(conn, excess);
} }
} else {
else { infof(data,
infof(data,
"Excess found in a non pipelined read:" "Excess found in a non pipelined read:"
" excess = %zu" " excess = %zu"
", size = %" FORMAT_OFF_T ", size = %" FORMAT_OFF_T
", maxdownload = %" FORMAT_OFF_T ", maxdownload = %" FORMAT_OFF_T
", bytecount = %" FORMAT_OFF_T "\n", ", bytecount = %" FORMAT_OFF_T "\n",
excess, k->size, k->maxdownload, k->bytecount); excess, k->size, k->maxdownload, k->bytecount);
}
} }
nread = (ssize_t) (k->maxdownload - k->bytecount); nread = (ssize_t) (k->maxdownload - k->bytecount);