Skip to content

Commit

Permalink
fixup! src: implement native quic layer
Browse files Browse the repository at this point in the history
  • Loading branch information
jasnell committed Aug 21, 2022
1 parent 82f11c7 commit 4f25588
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions src/quic/quic.cc
Expand Up @@ -282,18 +282,18 @@ void Packet::Done(int status) {

Packet::operator uv_buf_t() const {
CHECK(data_);
return uv_buf_t {
reinterpret_cast<char*>(data_->ptr_),
data_->len_
};
uv_buf_t buf;;
buf.base = reinterpret_cast<char*>(data_->ptr_);
buf.len = data_->len_;
return buf;
}

Packet::operator ngtcp2_vec() const {
CHECK(data_);
return ngtcp2_vec {
data_->ptr_,
data_->len_
};
ngtcp2_vec vec;
vec.base = data_->ptr_;
vec.len = data_->len_;
return vec;
}

void Packet::Truncate(size_t len) {
Expand Down Expand Up @@ -429,17 +429,17 @@ Store::Store(v8::Local<v8::ArrayBufferView> view)
: Store(view->Buffer()->GetBackingStore(), view->ByteLength(), view->ByteOffset()) {}

Store::operator uv_buf_t() const {
return uv_buf_t {
store_ != nullptr ? static_cast<char*>(store_->Data()) + offset_ : nullptr,
length_
};
uv_buf_t buf;
buf.base = store_ != nullptr ? static_cast<char*>(store_->Data()) + offset_ : nullptr,
buf.len = length_;
return buf;
}

Store::operator ngtcp2_vec() const {
return ngtcp2_vec {
store_ != nullptr ? static_cast<uint8_t*>(store_->Data()) + offset_ : nullptr,
length_
};
ngtcp2_vec vec;
vec.base = store_ != nullptr ? static_cast<uint8_t*>(store_->Data()) + offset_ : nullptr;
vec.len = length_;
return vec;
}

// ======================================================================================
Expand Down

0 comments on commit 4f25588

Please sign in to comment.