diff options
author | Ryan Dahl <ry@tinyclouds.org> | 2011-07-19 02:18:10 -0700 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2011-07-19 02:19:27 -0700 |
commit | 6050af4fd7c103c52c5081210f84237eac19108c (patch) | |
tree | 9ffe94058798de40739e38472e3603a1264a9a92 | |
parent | 061ce7b0ac370c8a5ae93d95ab7da171cbd488f0 (diff) | |
download | node-6050af4fd7c103c52c5081210f84237eac19108c.tar.gz |
net_uv: properly initialize writeQueueSize
Fixes simple/test-tcp-wrap-listen.js
-rw-r--r-- | src/pipe_wrap.cc | 1 | ||||
-rw-r--r-- | src/stream_wrap.cc | 3 | ||||
-rw-r--r-- | src/stream_wrap.h | 2 | ||||
-rw-r--r-- | src/tcp_wrap.cc | 1 |
4 files changed, 4 insertions, 3 deletions
diff --git a/src/pipe_wrap.cc b/src/pipe_wrap.cc index adbeb0f8c..5d0c5128e 100644 --- a/src/pipe_wrap.cc +++ b/src/pipe_wrap.cc @@ -85,6 +85,7 @@ class PipeWrap : StreamWrap { int r = uv_pipe_init(&handle_); assert(r == 0); // How do we proxy this error up to javascript? // Suggestion: uv_pipe_init() returns void. + UpdateWriteQueueSize(); } static Handle<Value> Bind(const Arguments& args) { diff --git a/src/stream_wrap.cc b/src/stream_wrap.cc index 3da51d960..528c523bf 100644 --- a/src/stream_wrap.cc +++ b/src/stream_wrap.cc @@ -72,12 +72,11 @@ StreamWrap::StreamWrap(Handle<Object> object, uv_stream_t* stream) : HandleWrap(object, (uv_handle_t*)stream) { stream_ = stream; stream->data = this; - - UpdateWriteQueueSize(); } void StreamWrap::UpdateWriteQueueSize() { + HandleScope scope; object_->Set(write_queue_size_sym, Integer::New(stream_->write_queue_size)); } diff --git a/src/stream_wrap.h b/src/stream_wrap.h index d1b442fa8..f3e2c462f 100644 --- a/src/stream_wrap.h +++ b/src/stream_wrap.h @@ -21,9 +21,9 @@ class StreamWrap : public HandleWrap { StreamWrap(v8::Handle<v8::Object> object, uv_stream_t* stream); virtual ~StreamWrap() { } void StateChange() { } + void UpdateWriteQueueSize(); private: - void UpdateWriteQueueSize(); static inline char* NewSlab(v8::Handle<v8::Object> global, v8::Handle<v8::Object> wrap_obj); // Callbacks for libuv diff --git a/src/tcp_wrap.cc b/src/tcp_wrap.cc index 814f7e235..51ff96618 100644 --- a/src/tcp_wrap.cc +++ b/src/tcp_wrap.cc @@ -111,6 +111,7 @@ class TCPWrap : public StreamWrap { int r = uv_tcp_init(&handle_); assert(r == 0); // How do we proxy this error up to javascript? // Suggestion: uv_tcp_init() returns void. + UpdateWriteQueueSize(); } ~TCPWrap() { |