diff options
author | Fedor Indutny <fedor@indutny.com> | 2015-03-01 00:46:43 +0300 |
---|---|---|
committer | Rod Vagg <rod@vagg.org> | 2015-02-28 16:50:36 -0600 |
commit | 2b47fd2eb615511ee1f2f29d496cd817e54740e1 (patch) | |
tree | 073309b433d3b26f1078ce1b4337d32f24359a98 /src/stream_base-inl.h | |
parent | c9151547bcc61bd528810a5f294b180ac30c2e45 (diff) | |
download | android-node-v8-2b47fd2eb615511ee1f2f29d496cd817e54740e1.tar.gz android-node-v8-2b47fd2eb615511ee1f2f29d496cd817e54740e1.tar.bz2 android-node-v8-2b47fd2eb615511ee1f2f29d496cd817e54740e1.zip |
stream_base: `.writev()` has limited support
Only TCP and JSStream do support `.writev()` on all platforms at the
moment. Ensure that it won't be enabled everywhere.
Fix: https://github.com/iojs/io.js/issues/995
PR-URL: https://github.com/iojs/io.js/pull/1008
Reviewed-by: Bert Belder <bertbelder@gmail.com>
Reviewed-By: Rod Vagg <rod@vagg.org>
Diffstat (limited to 'src/stream_base-inl.h')
-rw-r--r-- | src/stream_base-inl.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/stream_base-inl.h b/src/stream_base-inl.h index 2167bdeb13..490909456b 100644 --- a/src/stream_base-inl.h +++ b/src/stream_base-inl.h @@ -21,7 +21,9 @@ using v8::String; using v8::Value; template <class Base> -void StreamBase::AddMethods(Environment* env, Handle<FunctionTemplate> t) { +void StreamBase::AddMethods(Environment* env, + Handle<FunctionTemplate> t, + int flags) { HandleScope scope(env->isolate()); enum PropertyAttribute attributes = @@ -36,7 +38,8 @@ void StreamBase::AddMethods(Environment* env, Handle<FunctionTemplate> t) { env->SetProtoMethod(t, "readStart", JSMethod<Base, &StreamBase::ReadStart>); env->SetProtoMethod(t, "readStop", JSMethod<Base, &StreamBase::ReadStop>); env->SetProtoMethod(t, "shutdown", JSMethod<Base, &StreamBase::Shutdown>); - env->SetProtoMethod(t, "writev", JSMethod<Base, &StreamBase::Writev>); + if ((flags & kFlagHasWritev) != 0) + env->SetProtoMethod(t, "writev", JSMethod<Base, &StreamBase::Writev>); env->SetProtoMethod(t, "writeBuffer", JSMethod<Base, &StreamBase::WriteBuffer>); |