src: remove redundant JSStream::DoAfterWrite
`Finish<WriteWrap>` already does the same thing and is called immediately afterwards anyway. PR-URL: https://github.com/nodejs/node/pull/17713 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Anatoli Papirovski <apapirovski@mac.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
parent
1af82f3d0e
commit
901e9a1983
@ -136,7 +136,6 @@ class JSStreamWrap extends Socket {
|
|||||||
if (!self._dequeue(item))
|
if (!self._dequeue(item))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
handle.doAfterWrite(req);
|
|
||||||
handle.finishWrite(req, errCode);
|
handle.finishWrite(req, errCode);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -196,7 +195,6 @@ class JSStreamWrap extends Socket {
|
|||||||
|
|
||||||
const errCode = uv.UV_ECANCELED;
|
const errCode = uv.UV_ECANCELED;
|
||||||
if (item.type === 'write') {
|
if (item.type === 'write') {
|
||||||
handle.doAfterWrite(req);
|
|
||||||
handle.finishWrite(req, errCode);
|
handle.finishWrite(req, errCode);
|
||||||
} else if (item.type === 'shutdown') {
|
} else if (item.type === 'shutdown') {
|
||||||
handle.finishShutdown(req, errCode);
|
handle.finishShutdown(req, errCode);
|
||||||
|
@ -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>
|
template <class Wrap>
|
||||||
void JSStream::Finish(const FunctionCallbackInfo<Value>& args) {
|
void JSStream::Finish(const FunctionCallbackInfo<Value>& args) {
|
||||||
Wrap* w;
|
Wrap* w;
|
||||||
@ -234,7 +223,6 @@ void JSStream::Initialize(Local<Object> target,
|
|||||||
|
|
||||||
AsyncWrap::AddWrapMethods(env, t);
|
AsyncWrap::AddWrapMethods(env, t);
|
||||||
|
|
||||||
env->SetProtoMethod(t, "doAfterWrite", DoAfterWrite);
|
|
||||||
env->SetProtoMethod(t, "finishWrite", Finish<WriteWrap>);
|
env->SetProtoMethod(t, "finishWrite", Finish<WriteWrap>);
|
||||||
env->SetProtoMethod(t, "finishShutdown", Finish<ShutdownWrap>);
|
env->SetProtoMethod(t, "finishShutdown", Finish<ShutdownWrap>);
|
||||||
env->SetProtoMethod(t, "readBuffer", ReadBuffer);
|
env->SetProtoMethod(t, "readBuffer", ReadBuffer);
|
||||||
|
@ -37,7 +37,6 @@ class JSStream : public AsyncWrap, public StreamBase {
|
|||||||
AsyncWrap* GetAsyncWrap() override;
|
AsyncWrap* GetAsyncWrap() override;
|
||||||
|
|
||||||
static void New(const v8::FunctionCallbackInfo<v8::Value>& args);
|
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 ReadBuffer(const v8::FunctionCallbackInfo<v8::Value>& args);
|
||||||
static void EmitEOF(const v8::FunctionCallbackInfo<v8::Value>& args);
|
static void EmitEOF(const v8::FunctionCallbackInfo<v8::Value>& args);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user