Commit 6f83d325 authored by Harris Hancock's avatar Harris Hancock

Log more info in VectorOutputStream::write() KJ_REQUIRE

This is to help debug an issue in Cloudflare Workers. I also added the same debug info to the ArrayOutputStream case, mostly for pleasing symmetry.
parent 8b9bd720
......@@ -273,7 +273,7 @@ ArrayPtr<byte> ArrayOutputStream::getWriteBuffer() {
void ArrayOutputStream::write(const void* src, size_t size) {
if (src == fillPos) {
// Oh goody, the caller wrote directly into our buffer.
KJ_REQUIRE(size <= array.end() - fillPos);
KJ_REQUIRE(size <= array.end() - fillPos, size, fillPos, array.end() - fillPos);
fillPos += size;
} else {
KJ_REQUIRE(size <= (size_t)(array.end() - fillPos),
......@@ -301,7 +301,7 @@ ArrayPtr<byte> VectorOutputStream::getWriteBuffer() {
void VectorOutputStream::write(const void* src, size_t size) {
if (src == fillPos) {
// Oh goody, the caller wrote directly into our buffer.
KJ_REQUIRE(size <= vector.end() - fillPos);
KJ_REQUIRE(size <= vector.end() - fillPos, size, fillPos, vector.end() - fillPos);
fillPos += size;
} else {
if (vector.end() - fillPos < size) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment