Loading lib/transfer.c +17 −12 Original line number Diff line number Diff line Loading @@ -383,6 +383,8 @@ static int data_pending(const struct connectdata *conn) static void read_rewind(struct connectdata *conn, size_t thismuch) { DEBUGASSERT(conn->read_pos >= thismuch); conn->read_pos -= thismuch; conn->bits.stream_was_rewound = TRUE; Loading Loading @@ -634,6 +636,8 @@ static CURLcode readwrite_data(struct SessionHandle *data, if((-1 != k->maxdownload) && (k->bytecount + nread >= k->maxdownload)) { if(conn->data->multi && Curl_multi_canPipeline(conn->data->multi)) { /* The 'excess' amount below can't be more than BUFSIZE which always will fit in a size_t */ size_t excess = (size_t)(k->bytecount + nread - k->maxdownload); Loading @@ -647,6 +651,7 @@ static CURLcode readwrite_data(struct SessionHandle *data, k->size, k->maxdownload, k->bytecount, nread); read_rewind(conn, excess); } } nread = (ssize_t) (k->maxdownload - k->bytecount); if(nread < 0 ) /* this should be unusual */ Loading Loading
lib/transfer.c +17 −12 Original line number Diff line number Diff line Loading @@ -383,6 +383,8 @@ static int data_pending(const struct connectdata *conn) static void read_rewind(struct connectdata *conn, size_t thismuch) { DEBUGASSERT(conn->read_pos >= thismuch); conn->read_pos -= thismuch; conn->bits.stream_was_rewound = TRUE; Loading Loading @@ -634,6 +636,8 @@ static CURLcode readwrite_data(struct SessionHandle *data, if((-1 != k->maxdownload) && (k->bytecount + nread >= k->maxdownload)) { if(conn->data->multi && Curl_multi_canPipeline(conn->data->multi)) { /* The 'excess' amount below can't be more than BUFSIZE which always will fit in a size_t */ size_t excess = (size_t)(k->bytecount + nread - k->maxdownload); Loading @@ -647,6 +651,7 @@ static CURLcode readwrite_data(struct SessionHandle *data, k->size, k->maxdownload, k->bytecount, nread); read_rewind(conn, excess); } } nread = (ssize_t) (k->maxdownload - k->bytecount); if(nread < 0 ) /* this should be unusual */ Loading