Browse Source

net_uv: properly initialize writeQueueSize

Fixes simple/test-tcp-wrap-listen.js
v0.7.4-release
Ryan Dahl 14 years ago
parent
commit
6050af4fd7
  1. 1
      src/pipe_wrap.cc
  2. 3
      src/stream_wrap.cc
  3. 2
      src/stream_wrap.h
  4. 1
      src/tcp_wrap.cc

1
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) {

3
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));
}

2
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

1
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() {

Loading…
Cancel
Save