Skip to content

Instantly share code, notes, and snippets.

@BitPuffin
Created August 15, 2014 17:00
Show Gist options
  • Select an option

  • Save BitPuffin/9fdd86651ed8cd6b308b to your computer and use it in GitHub Desktop.

Select an option

Save BitPuffin/9fdd86651ed8cd6b308b to your computer and use it in GitHub Desktop.
void DownloadOperation::step() {
#define BUFFSIZE 200
char buf[BUFFSIZE];
std::streamsize readamount = this->httpstream.rdbuf()->sgetn(buf, BUFFSIZE);
if(!this->httpstream.eof()) {
this->outfile.write(buf, readamount);
} else {
status_mutex.lock();
this->completed = true;
status_mutex.unlock();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment