Skip to content

quic: copy options buffer instead of detaching - #61403

Merged
nodejs-github-bot merged 1 commit into
nodejs:mainfrom
legendecas:quic-certs
Jan 22, 2026
Merged

nodejs-github-bot merged 1 commit into
nodejs:mainfrom
legendecas:quic-certs

Conversation

@legendecas

Copy link
Copy Markdown
Member

The certs could be allocated in a pooled buffer, like Buffer.from, and
Buffer.allocUnsafe (used by fs.readFileSync, etc).

Refs: #61372

@nodejs-github-bot nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. lib / src Issues and PRs involving general changes in the lib/ or src/ directories. needs-ci PRs that need a full CI run. labels Jan 16, 2026
@legendecas legendecas added the quic Issues and PRs related to the QUIC transport implementation. label Jan 16, 2026

@Renegade334 Renegade334 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was going to suggest a similar approach.

The commit message should probably reflect that this applies to all buffer-based quic options, not just SessionOptions#certs.

Comment thread src/quic/data.cc Resolved
@legendecas
legendecas force-pushed the quic-certs branch 2 times, most recently from da77e1e to b8f90b8 Compare January 16, 2026 21:27
@legendecas legendecas changed the title quic: copy options.certs buffer instead of detaching quic: copy optionsbuffer instead of detaching Jan 16, 2026
@legendecas legendecas changed the title quic: copy optionsbuffer instead of detaching quic: copy options buffer instead of detaching Jan 16, 2026
The certs could be allocated in a pooled buffer, like `Buffer.from`, and
`Buffer.allocUnsafe` (used by `fs.readFileSync`, etc).
@codecov

codecov Bot commented Jan 16, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 50.00000% with 12 lines in your changes missing coverage. Please review.
✅ Project coverage is 88.51%. Comparing base (e3071d5) to head (7a9130c).
⚠️ Report is 54 commits behind head on main.

Files with missing lines Patch % Lines
src/quic/data.cc 52.63% 9 Missing ⚠️
src/quic/tlscontext.cc 25.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #61403      +/-   ##
==========================================
- Coverage   88.53%   88.51%   -0.02%     
==========================================
  Files         704      704              
  Lines      208797   208806       +9     
  Branches    40316    40308       -8     
==========================================
- Hits       184857   184834      -23     
- Misses      15923    15971      +48     
+ Partials     8017     8001      -16     
Files with missing lines Coverage Δ
src/quic/data.h 36.36% <ø> (-27.28%) ⬇️
src/quic/endpoint.cc 56.64% <100.00%> (+0.12%) ⬆️
src/quic/tlscontext.cc 37.47% <25.00%> (+0.62%) ⬆️
src/quic/data.cc 52.08% <52.63%> (-2.67%) ⬇️

... and 33 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@legendecas legendecas added the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Jan 18, 2026
@github-actions github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Jan 18, 2026
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@avivkeller avivkeller added the author ready PRs with CI started, the required approvals, and no outstanding review comments. label Jan 19, 2026
Comment thread src/quic/data.cc
auto length = view->ByteLength();
auto offset = view->ByteOffset();
auto dest = ArrayBuffer::NewBackingStore(
isolate, length, v8::BackingStoreInitializationMode::kUninitialized);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be nice if we could handle allocation failures in these calls too