mirror of
https://github.com/klzgrad/naiveproxy.git
synced 2024-11-24 06:16:30 +03:00
Fix HttpProxySocket early data return value
This commit is contained in:
parent
458c165811
commit
4a944da697
@ -148,16 +148,17 @@ int HttpProxySocket::Read(IOBuffer* buf,
|
||||
DCHECK(callback);
|
||||
|
||||
if (!buffer_.empty()) {
|
||||
was_ever_used_ = true;
|
||||
int data_len = buffer_.size();
|
||||
if (data_len <= buf_len) {
|
||||
std::memcpy(buf->data(), buffer_.data(), data_len);
|
||||
buffer_.clear();
|
||||
return data_len;
|
||||
} else {
|
||||
std::memcpy(buf->data(), buffer_.data(), buf_len);
|
||||
buffer_ = buffer_.substr(buf_len);
|
||||
return buf_len;
|
||||
}
|
||||
was_ever_used_ = true;
|
||||
return OK;
|
||||
}
|
||||
|
||||
int rv = transport_->Read(
|
||||
|
Loading…
Reference in New Issue
Block a user