mirror of
https://github.com/Sude-/lgogdownloader.git
synced 2024-11-20 11:49:17 +01:00
Fix the code that writes curl result following advise on http://stackoverflow.com/questions/8020640/libcurl-output-to-variable-instead-of-textfile
This commit is contained in:
parent
db09947af2
commit
1ebf3b0396
@ -1152,7 +1152,10 @@ size_t Downloader::writeMemoryCallback(char *ptr, size_t size, size_t nmemb, voi
|
|||||||
|
|
||||||
size_t Downloader::writeData(void *ptr, size_t size, size_t nmemb, FILE *stream)
|
size_t Downloader::writeData(void *ptr, size_t size, size_t nmemb, FILE *stream)
|
||||||
{
|
{
|
||||||
return fwrite(ptr, size, nmemb, stream);
|
std::ostream *ostream = (std::ostream*) stream;
|
||||||
|
size_t count = size * nmemb;
|
||||||
|
ostream->write((const char*)ptr, count);
|
||||||
|
return count;
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t Downloader::readData(void *ptr, size_t size, size_t nmemb, FILE *stream)
|
size_t Downloader::readData(void *ptr, size_t size, size_t nmemb, FILE *stream)
|
||||||
|
Loading…
Reference in New Issue
Block a user