UI, http with gzip, etc.

This commit is contained in:
Henrik Rydgard committed 2013-06-04 22:32:04 +02:00
1 parent 3b9750ee49
commit a509d38357
11 files changed
+229 -32

No files matched your search

+4 -2
View File
@@ -46,8 +46,10 @@ void Buffer::AppendValue(int value) {
void Buffer::Take(size_t length, std::string *dest) {
CHECK_LE(length, data_.size());
dest->resize(length);
memcpy(&(*dest)[0], &data_[0], length);
data_.erase(data_.begin(), data_.begin() + length);
if (length > 0) {
memcpy(&(*dest)[0], &data_[0], length);
data_.erase(data_.begin(), data_.begin() + length);
}
}
int Buffer::TakeLineCRLF(std::string *dest) {