Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

src: remove redundant JSStream::DoAfterWrite #17713

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions lib/internal/wrap_js_stream.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,6 @@ class JSStreamWrap extends Socket {
if (!self._dequeue(item))
return;

handle.doAfterWrite(req);
handle.finishWrite(req, errCode);
});
}
Expand Down Expand Up @@ -196,7 +195,6 @@ class JSStreamWrap extends Socket {

const errCode = uv.UV_ECANCELED;
if (item.type === 'write') {
handle.doAfterWrite(req);
handle.finishWrite(req, errCode);
} else if (item.type === 'shutdown') {
handle.finishShutdown(req, errCode);
Expand Down
12 changes: 0 additions & 12 deletions src/js_stream.cc
Original file line number Diff line number Diff line change
Expand Up @@ -169,17 +169,6 @@ void JSStream::New(const FunctionCallbackInfo<Value>& args) {
}


void JSStream::DoAfterWrite(const FunctionCallbackInfo<Value>& args) {
JSStream* wrap;
CHECK(args[0]->IsObject());
WriteWrap* w;
ASSIGN_OR_RETURN_UNWRAP(&wrap, args.Holder());
ASSIGN_OR_RETURN_UNWRAP(&w, args[0].As<Object>());

w->Done(0);
}


template <class Wrap>
void JSStream::Finish(const FunctionCallbackInfo<Value>& args) {
Wrap* w;
Expand Down Expand Up @@ -234,7 +223,6 @@ void JSStream::Initialize(Local<Object> target,

AsyncWrap::AddWrapMethods(env, t);

env->SetProtoMethod(t, "doAfterWrite", DoAfterWrite);
env->SetProtoMethod(t, "finishWrite", Finish<WriteWrap>);
env->SetProtoMethod(t, "finishShutdown", Finish<ShutdownWrap>);
env->SetProtoMethod(t, "readBuffer", ReadBuffer);
Expand Down
1 change: 0 additions & 1 deletion src/js_stream.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ class JSStream : public AsyncWrap, public StreamBase {
AsyncWrap* GetAsyncWrap() override;

static void New(const v8::FunctionCallbackInfo<v8::Value>& args);
static void DoAfterWrite(const v8::FunctionCallbackInfo<v8::Value>& args);
static void ReadBuffer(const v8::FunctionCallbackInfo<v8::Value>& args);
static void EmitEOF(const v8::FunctionCallbackInfo<v8::Value>& args);

Expand Down