Bugfix: Sockets not properly reattached if reconnected during disconnect event.
authorRyan <ry@tinyclouds.org>
Sun, 12 Jul 2009 13:02:13 +0000 (15:02 +0200)
committerRyan <ry@tinyclouds.org>
Mon, 13 Jul 2009 14:38:55 +0000 (16:38 +0200)
commit041af82b8c4d7655ee238e09259c4a69ed296583
treee2d9ff130a74223011ecf87534470738b6cd7978
parentd4fcc0a753af01df137bebbcab6f2f79b2c145ed
Bugfix: Sockets not properly reattached if reconnected during disconnect event.

The problem was that Connection::on_close was calling Detach() directly
after executing the "disconnect" event. Since we had a boolean attach count,
this was leaving sockets detached even if they had reattached in during the
event.

 * Added many asserts in http.cc and net.cc to ensure that sockets are
   connected when they should be.

 * Changed ObjectWrap to use a reference count instead of boolean attached_
   value.

 * Fixed similar bug in Timer.
src/http.cc
src/net.cc
src/net.h
src/object_wrap.h
src/timer.cc
test/mjsunit/test-tcp-reconnect.js