src,stream: improve WriteString · nodejs/node@e7925e6 · GitHub
Skip to content

Commit e7925e6

Browse files
ywave620RafaelGSS
authored andcommitted
src,stream: improve WriteString
Introduce HasDoTryWrite and make use of it in WriteString PR-URL: #51155 Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
1 parent 85ee2f7 commit e7925e6

3 files changed

Lines changed: 5 additions & 2 deletions

File tree

src/stream_base.cc

Lines changed: 2 additions & 2 deletions

src/stream_base.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,8 @@ class StreamResource {
244244
// `*bufs` and `*count` accordingly. This is a no-op by default.
245245
// Return 0 for success and a libuv error code for failures.
246246
virtual int DoTryWrite(uv_buf_t** bufs, size_t* count);
247+
// Indicates whether this subclass overrides the DoTryWrite
248+
virtual inline bool HasDoTryWrite() const { return false; }
247249
// Initiate a write of data.
248250
// Upon an immediate failure, a libuv error code is returned,
249251
// w->Done() will never be called and caller should free `bufs`.

src/stream_wrap.h

Lines changed: 1 addition & 0 deletions

0 commit comments

Comments
 (0)