mirror of
https://github.com/klzgrad/naiveproxy.git
synced 2024-11-24 14:26:09 +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);
|
DCHECK(callback);
|
||||||
|
|
||||||
if (!buffer_.empty()) {
|
if (!buffer_.empty()) {
|
||||||
|
was_ever_used_ = true;
|
||||||
int data_len = buffer_.size();
|
int data_len = buffer_.size();
|
||||||
if (data_len <= buf_len) {
|
if (data_len <= buf_len) {
|
||||||
std::memcpy(buf->data(), buffer_.data(), data_len);
|
std::memcpy(buf->data(), buffer_.data(), data_len);
|
||||||
buffer_.clear();
|
buffer_.clear();
|
||||||
|
return data_len;
|
||||||
} else {
|
} else {
|
||||||
std::memcpy(buf->data(), buffer_.data(), buf_len);
|
std::memcpy(buf->data(), buffer_.data(), buf_len);
|
||||||
buffer_ = buffer_.substr(buf_len);
|
buffer_ = buffer_.substr(buf_len);
|
||||||
|
return buf_len;
|
||||||
}
|
}
|
||||||
was_ever_used_ = true;
|
|
||||||
return OK;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int rv = transport_->Read(
|
int rv = transport_->Read(
|
||||||
|
Loading…
Reference in New Issue
Block a user