| 788 | } |
| 789 | |
| 790 | int CURLConnection::readBuffer(void *buf, size_t size) |
| 791 | { |
| 792 | // double downloadSpeed; |
| 793 | // CURLcode re = curl_easy_getinfo(pEasyHandle->http_handle, CURLINFO_SPEED_DOWNLOAD, &downloadSpeed); |
| 794 | /*if (re == CURLE_OK) |
| 795 | av_log(mCurlhttpContext.hd,AV_LOG_DEBUG,"download speed is %f\n",downloadSpeed);*/ |
| 796 | uint32_t want = std::min(RingBuffergetMaxReadSize(pRbuf), (uint32_t) size); |
| 797 | |
| 798 | if (want > 0 && RingBufferReadData(pRbuf, (char *) buf, want) == want) { |
| 799 | mFilePos += want; |
| 800 | return want; |
| 801 | } |
| 802 | |
| 803 | /* check if we finished prematurely */ |
| 804 | if (!still_running && |
| 805 | (mFileSize > 0 && mFilePos != mFileSize)) { |
| 806 | AF_LOGE("%s - Transfer ended before entire file was retrieved pos %lld, size %lld", |
| 807 | __FUNCTION__, mFilePos, mFileSize); |
| 808 | // return -1; |
| 809 | } |
| 810 | |
| 811 | return 0; |
| 812 | } |
| 813 | |
| 814 | void CURLConnection::updateSource(const string &location) |
| 815 | { |
no test coverage detected